generated from ztimson/template
11 lines
323 B
JavaScript
11 lines
323 B
JavaScript
/** Error intended to be returned by the HTTP API. */
|
|
export class ServiceError extends Error {
|
|
constructor(code, message, status = 500, details = undefined) {
|
|
super(message);
|
|
this.name = 'ServiceError';
|
|
this.code = code;
|
|
this.status = status;
|
|
if (details !== undefined) this.details = details;
|
|
}
|
|
}
|