We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom-error-definition
This is the native constructor:
class Error { constructor(message, options) {} }
This is custom constructor that is compatible with serialize-error:
serialize-error
class CustomError extends Error { constructor(message) { super(message) } }
This is custom constructor that is not compatible with serialize-error:
class CustomError extends Error { constructor(message, requiredParameter) { super(message) if (!requiredParameter) { throw new Error('requiredParameter missing') } } }
Two-part solution:
Error
serialize-error/index.js
Line 173 in 6f6102f
errorConstructors.set('CustomError', message => new CustomError(message, {}))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
custom-error-definition
: Enforce standard error constructors when subclassing (message, options) eslint-plugin-unicorn#1810This is the native constructor:
This is custom constructor that is compatible with
serialize-error
:This is custom constructor that is not compatible with
serialize-error
:Two-part solution:
Error
instead, here:serialize-error/index.js
Line 173 in 6f6102f
The text was updated successfully, but these errors were encountered: