replace log by throw (#10167)

as title
This commit is contained in:
martmull
2025-02-12 17:31:41 +01:00
committed by GitHub
parent fb936cccfb
commit b66289c44c
3 changed files with 12 additions and 4 deletions

View File

@ -14,5 +14,6 @@ export enum ServerlessFunctionExceptionCode {
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',
}

View File

@ -193,8 +193,9 @@ export class ServerlessFunctionService {
);
if (deepEqual(latestCode, draftCode)) {
throw new Error(
throw new ServerlessFunctionException(
'Cannot publish a new version when code has not changed',
ServerlessFunctionExceptionCode.SERVERLESS_FUNCTION_CODE_UNCHANGED,
);
}
}