## Context In some CustomException exceptions, we were instantiating a code without initializing it which was overriding the parent code and it was then lost when retrieving it in filters. Removing them to make sure we don't reproduce this pattern
19 lines
861 B
TypeScript
19 lines
861 B
TypeScript
import { CustomException } from 'src/utils/custom-exception';
|
|
|
|
export class ServerlessFunctionException extends CustomException {
|
|
constructor(message: string, code: ServerlessFunctionExceptionCode) {
|
|
super(message, code);
|
|
}
|
|
}
|
|
|
|
export enum ServerlessFunctionExceptionCode {
|
|
SERVERLESS_FUNCTION_NOT_FOUND = 'SERVERLESS_FUNCTION_NOT_FOUND',
|
|
SERVERLESS_FUNCTION_VERSION_NOT_FOUND = 'SERVERLESS_FUNCTION_VERSION_NOT_FOUND',
|
|
FEATURE_FLAG_INVALID = 'FEATURE_FLAG_INVALID',
|
|
SERVERLESS_FUNCTION_ALREADY_EXIST = 'SERVERLESS_FUNCTION_ALREADY_EXIST',
|
|
SERVERLESS_FUNCTION_NOT_READY = 'SERVERLESS_FUNCTION_NOT_READY',
|
|
SERVERLESS_FUNCTION_BUILDING = 'SERVERLESS_FUNCTION_BUILDING',
|
|
SERVERLESS_FUNCTION_CODE_UNCHANGED = 'SERVERLESS_FUNCTION_CODE_UNCHANGED',
|
|
SERVERLESS_FUNCTION_EXECUTION_LIMIT_REACHED = 'SERVERLESS_FUNCTION_EXECUTION_LIMIT_REACHED',
|
|
}
|