backend-common: more informative error message when no url reader is matched

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-08-05 19:16:23 +02:00
parent 589dc54257
commit f7ce7c5659
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-common': patch
---
Use a more informative error message when URL reading isn't allowed due to no reader matching the target URL.
@@ -52,7 +52,11 @@ export class UrlReaderPredicateMux implements UrlReader {
}
}
throw new NotAllowedError(`Reading from '${url}' is not allowed`);
throw new NotAllowedError(
`Reading from '${url}' is not allowed. ` +
`You may need to configure an integration for the target host, or add it ` +
`to the configured list of allowed hosts at 'backend.reading.allow'`,
);
}
async readUrl(