errors: add NotImplementedError
Co-authored-by: Harry Hogg <hhogg@spotify.com> Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/backend-app-api': patch
|
||||
'@backstage/errors': patch
|
||||
---
|
||||
|
||||
Add NotImplementedError
|
||||
@@ -38,6 +38,7 @@ import {
|
||||
NotModifiedError,
|
||||
serializeError,
|
||||
} from '@backstage/errors';
|
||||
import { NotImplementedError } from '@backstage/errors';
|
||||
|
||||
/**
|
||||
* Options used to create a {@link MiddlewareFactory}.
|
||||
@@ -257,6 +258,8 @@ function getStatusCode(error: Error): number {
|
||||
return 404;
|
||||
case ConflictError.name:
|
||||
return 409;
|
||||
case NotImplementedError.name:
|
||||
return 501;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -74,6 +74,13 @@ export class ConflictError extends CustomErrorBase {}
|
||||
*/
|
||||
export class NotModifiedError extends CustomErrorBase {}
|
||||
|
||||
/**
|
||||
* The server does not support the functionality required to fulfill the request.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export class NotImplementedError extends CustomErrorBase {}
|
||||
|
||||
/**
|
||||
* An error that forwards an underlying cause with additional context in the message.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,7 @@ export {
|
||||
NotAllowedError,
|
||||
NotFoundError,
|
||||
NotModifiedError,
|
||||
NotImplementedError,
|
||||
} from './common';
|
||||
export { CustomErrorBase } from './CustomErrorBase';
|
||||
export { ResponseError } from './ResponseError';
|
||||
|
||||
Reference in New Issue
Block a user