From ddf7b5ed912a15a829ae884b0b9809b39091c071 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Fri, 14 Apr 2023 11:53:38 +0200 Subject: [PATCH] scaffolder-backend: NotAllowedError instead of InputError Signed-off-by: Vincenzo Scamporlino --- .../src/scaffolder/tasks/NunjucksWorkflowRunner.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts index d3ed2d8e03..a82ad1ae55 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts @@ -26,7 +26,7 @@ import fs from 'fs-extra'; import path from 'path'; import nunjucks from 'nunjucks'; import { JsonObject, JsonValue } from '@backstage/types'; -import { InputError } from '@backstage/errors'; +import { InputError, NotAllowedError } from '@backstage/errors'; import { PassThrough } from 'stream'; import { generateExampleOutput, isTruthy } from './helper'; import { validate as validateJsonSchema } from 'jsonschema'; @@ -297,7 +297,7 @@ export class NunjucksWorkflowRunner implements WorkflowRunner { } if (!isActionAuthorized(decision, { action: action.id, input })) { - throw new InputError( + throw new NotAllowedError( `Unauthorized action: ${ action.id }. The action is not allowed. Input: ${JSON.stringify(