@ -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',
|
||||
}
|
||||
|
||||
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@ import {
|
||||
import { getStatusCombinationFromArray } from 'src/modules/workflow/workflow-status/utils/get-status-combination-from-array.util';
|
||||
import { getStatusCombinationFromUpdate } from 'src/modules/workflow/workflow-status/utils/get-status-combination-from-update.util';
|
||||
import { getWorkflowStatusesFromCombination } from 'src/modules/workflow/workflow-status/utils/get-statuses-from-combination.util';
|
||||
import { ServerlessFunctionExceptionCode } from 'src/engine/metadata-modules/serverless-function/serverless-function.exception';
|
||||
|
||||
export enum WorkflowVersionEventType {
|
||||
CREATE = 'CREATE',
|
||||
@ -174,9 +175,14 @@ export class WorkflowStatusesUpdateJob {
|
||||
// applied between draft and lastPublished version.
|
||||
// If no change have been applied, we just use the same
|
||||
// serverless function version
|
||||
this.logger.warn(
|
||||
`Error while publishing serverless function '${step.settings.input.serverlessFunctionId}': ${e}`,
|
||||
);
|
||||
if (
|
||||
e.code !==
|
||||
ServerlessFunctionExceptionCode.SERVERLESS_FUNCTION_CODE_UNCHANGED
|
||||
) {
|
||||
this.logger.error(
|
||||
`Error while publishing serverless function '${step.settings.input.serverlessFunctionId}': ${e}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const serverlessFunction =
|
||||
|
||||
Reference in New Issue
Block a user