diff --git a/.changeset/warm-moose-applaud.md b/.changeset/warm-moose-applaud.md new file mode 100644 index 0000000000..70ae20711a --- /dev/null +++ b/.changeset/warm-moose-applaud.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Clearer error message when preparer or publisher type can't be determined. diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.ts b/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.ts index 226f7e3836..84be130b79 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.ts @@ -50,7 +50,17 @@ export class Preparers implements PreparerBuilder { if (detected) { return detected; } - throw new Error(`No preparer integration found for url "${location}"`); + if (type) { + throw new Error( + `No preparer configuration available for type '${type}' with url "${location}". ` + + "Make sure you've added appropriate configuration in the 'scaffolder' configuration section", + ); + } else { + throw new Error( + `Failed to detect preparer type. Unable to determine integration type for location "${location}". ` + + "Please add appropriate configuration to the 'integrations' configuration section", + ); + } } throw new Error(`No preparer registered for type: "${protocol}"`); } diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/publish/publishers.ts b/plugins/scaffolder-backend/src/scaffolder/stages/publish/publishers.ts index 961fc45cae..03a4e884ba 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/publish/publishers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/publish/publishers.ts @@ -51,7 +51,17 @@ export class Publishers implements PublisherBuilder { if (detected) { return detected; } - throw new Error(`No preparer integration found for url "${location}"`); + if (type) { + throw new Error( + `No publisher configuration available for type '${type}' with url "${location}". ` + + "Make sure you've added appropriate configuration in the 'scaffolder' configuration section", + ); + } else { + throw new Error( + `Failed to detect publisher type. Unable to determine integration type for location "${location}". ` + + "Please add appropriate configuration to the 'integrations' configuration section", + ); + } } throw new Error(`No publisher registered for type: "${protocol}"`); }