refactor: make resonse error types validatable

This commit is contained in:
Rainer Killinger
2021-07-06 09:36:16 +02:00
parent 882483ee24
commit 4f2ca30dab
11 changed files with 22 additions and 0 deletions

View File

@@ -17,6 +17,8 @@ import {SCError} from '../error';
/**
* An error that is returned, when an internal server error occurred
*
* @validatable
*/
export class SCInternalServerErrorResponse extends SCError {
/**

View File

@@ -17,6 +17,8 @@ import {SCError} from '../error';
/**
* An error that is returned, when the used HTTP method is not allowed on the requested route
*
* @validatable
*/
export class SCMethodNotAllowedErrorResponse extends SCError {
/**

View File

@@ -17,6 +17,8 @@ import {SCError} from '../error';
/**
* An error that is returned when the requested route or resource was not found
*
* @validatable
*/
export class SCNotFoundErrorResponse extends SCError {
/**

View File

@@ -18,6 +18,8 @@ import {SCError} from '../error';
/**
* An error that is returned when the request is in the right format, but contains parameters that are invalid or not
* acceptable.
*
* @validatable
*/
export class SCParametersNotAcceptable extends SCError {
/**

View File

@@ -20,6 +20,8 @@ import {SCPluginMetaData} from '../routes/plugin-register';
* An error that is returned when a plugin with the same name is already registered, to prevent two copies of a plugin
* running at the same time.
* This usually indicates that there is more than one instance a plugin running.
*
* @validatable
*/
export class SCPluginAlreadyRegisteredErrorResponse extends SCError {
/**

View File

@@ -17,6 +17,8 @@ import {SCError} from '../error';
/**
* An error that is returned whenever there is an unexpected error while creating a plugin
*
* @validatable
*/
export class SCPluginRegisteringFailedErrorResponse extends SCError {
/**

View File

@@ -17,6 +17,8 @@ import {SCError} from '../error';
/**
* An error that is returned, when the request body is too large.
*
* @validatable
*/
export class SCRequestBodyTooLargeErrorResponse extends SCError {
/**

View File

@@ -17,6 +17,8 @@ import {SCError} from '../error';
/**
* An error that is returned whenever there is a syntax error
*
* @validatable
*/
export class SCSyntaxErrorResponse extends SCError {
/**

View File

@@ -17,6 +17,8 @@ import {SCError} from '../error';
/**
* An error that is returned, when to many request are submitted at once
*
* @validatable
*/
export class SCTooManyRequestsErrorResponse extends SCError {
/**

View File

@@ -17,6 +17,8 @@ import {SCError} from '../error';
/**
* An error that is returned when the content type of the request is not supported
*
* @validatable
*/
export class SCUnsupportedMediaTypeErrorResponse extends SCError {
/**

View File

@@ -18,6 +18,8 @@ import {SCError} from '../error';
/**
* An error that is returned when the validation of a request fails
*
* @validatable
*/
export class SCValidationErrorResponse extends SCError {
/**