diff --git a/.changeset/violet-games-stand.md b/.changeset/violet-games-stand.md new file mode 100644 index 0000000..bf6a290 --- /dev/null +++ b/.changeset/violet-games-stand.md @@ -0,0 +1,5 @@ +--- +"@spur.us/monocle-backend": patch +--- + +Add `name` property to errors diff --git a/packages/monocle-backend/src/errors.ts b/packages/monocle-backend/src/errors.ts index c76141b..c11b270 100644 --- a/packages/monocle-backend/src/errors.ts +++ b/packages/monocle-backend/src/errors.ts @@ -42,6 +42,7 @@ export class MonocleError extends CustomError { } ) { super(options); + this.name = 'MonocleError'; } } @@ -61,6 +62,7 @@ export class MonocleAPIError extends MonocleError { code: errorCodes.API_REQUEST_FAILED, message: `API request failed with status ${status}: ${statusText}`, }); + this.name = 'MonocleAPIError'; } } @@ -81,6 +83,7 @@ export class MonocleDecryptionError extends MonocleError { code: errorCodes.DECRYPTION_FAILED, message: `Local decryption failed: ${message}`, }); + this.name = 'MonocleDecryptionError'; } }