Skip to content

Commit

Permalink
scaffolder-backend: clarify type detection error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Rugvip committed Dec 19, 2020
1 parent eec95ab commit aed8f7f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-moose-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---

Clearer error message when preparer or publisher type can't be determined.
Original file line number Diff line number Diff line change
Expand Up @@ -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}"`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"`);
}
Expand Down

0 comments on commit aed8f7f

Please sign in to comment.