Looking at Node's documentation, SystemError
extends the Error
class. However, if you attempt to use SystemError
directly, Node will throw a ReferenceError
saying that SystemError
is undefined.
Clearly, according to the docs, it is possible to encounter an instance of SystemError
, but it seems impossible to recreate such an error in the usual way (e.g. throw new SystemError(args)
).
I would like to test some code which is designed to interact with the specified SystemError
API as detailed in the docs, but I have no idea how to recreate a SystemError
. Is this even possible?
require('errors')
or so, unlike the other errors it's not global. But I guess you shouldn't createSystemError
s yourself anyway. – Eatton