Clean step and edge errors (#14261)
- add filters for both resolvers - map to gql errors Should fix https://github.com/twentyhq/core-team-issues/issues/996
This commit is contained in:
+5
-5
@@ -164,7 +164,7 @@ export class WorkflowVersionStepWorkspaceService {
|
||||
if (!isDefined(workflowVersion.steps)) {
|
||||
throw new WorkflowVersionStepException(
|
||||
"Can't update step from undefined steps",
|
||||
WorkflowVersionStepExceptionCode.UNDEFINED,
|
||||
WorkflowVersionStepExceptionCode.INVALID_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ export class WorkflowVersionStepWorkspaceService {
|
||||
if (!isDeletingTrigger && !isDefined(workflowVersion.steps)) {
|
||||
throw new WorkflowVersionStepException(
|
||||
"Can't delete step from undefined steps",
|
||||
WorkflowVersionStepExceptionCode.UNDEFINED,
|
||||
WorkflowVersionStepExceptionCode.INVALID_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ export class WorkflowVersionStepWorkspaceService {
|
||||
if (step.type !== WorkflowActionType.FORM) {
|
||||
throw new WorkflowVersionStepException(
|
||||
'Step is not a form',
|
||||
WorkflowVersionStepExceptionCode.INVALID,
|
||||
WorkflowVersionStepExceptionCode.INVALID_REQUEST,
|
||||
{
|
||||
userFriendlyMessage: t`Step is not a form`,
|
||||
},
|
||||
@@ -478,7 +478,7 @@ export class WorkflowVersionStepWorkspaceService {
|
||||
if (!isDefined(newServerlessFunction)) {
|
||||
throw new WorkflowVersionStepException(
|
||||
'Fail to create Code Step',
|
||||
WorkflowVersionStepExceptionCode.FAILURE,
|
||||
WorkflowVersionStepExceptionCode.CODE_STEP_FAILURE,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -671,7 +671,7 @@ export class WorkflowVersionStepWorkspaceService {
|
||||
default:
|
||||
throw new WorkflowVersionStepException(
|
||||
`WorkflowActionType '${type}' unknown`,
|
||||
WorkflowVersionStepExceptionCode.UNKNOWN,
|
||||
WorkflowVersionStepExceptionCode.INVALID_REQUEST,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user