package.es.ApiDOMStructuredError.mjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apidom-error Show documentation
Show all versions of apidom-error Show documentation
Backward compatible custom ApiDOM errors with causes.
The newest version!
import ApiDOMError from "./ApiDOMError.mjs";
class ApiDOMStructuredError extends ApiDOMError {
constructor(message, structuredOptions) {
super(message, structuredOptions);
if (structuredOptions != null && typeof structuredOptions === 'object') {
const {
cause,
...causelessOptions
} = structuredOptions;
Object.assign(this, causelessOptions);
}
}
}
export default ApiDOMStructuredError;