configureCustomError
Configures a custom error by automatically setting the error's name
property to the class' constructor name.
Arguments
configureCustomError
() accepts the following arguments:
error: Error
- the custom error instancecaptureStackTrace: boolean = false
(optional) Captures and sets error's stack trace¹.
¹: See configureStackTrace()
for details.
import { configureCustomError } from "@aedart/support/exceptions";
class MyError extends Error {
constructor(message, options) {
super(message, options);
configureCustomError(this);
}
}
See Mozilla's documentation on Custom Error Types for additional information.