Forward the error message
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
This commit is contained in:
@@ -345,7 +345,7 @@ describe('PlaceholderProcessor', () => {
|
||||
},
|
||||
),
|
||||
).rejects.toThrow(
|
||||
'Placeholder $text could not form a URL out of ./a/b/catalog-info.yaml and ../c/catalog-info.yaml',
|
||||
'Placeholder $text could not form a URL out of ./a/b/catalog-info.yaml and ../c/catalog-info.yaml, TypeError: Invalid base URL: ./a/b/catalog-info.yaml',
|
||||
);
|
||||
|
||||
expect(read).not.toBeCalled();
|
||||
|
||||
@@ -216,13 +216,13 @@ function relativeUrl({
|
||||
|
||||
try {
|
||||
return resolveUrl(value, baseUrl);
|
||||
} catch (_) {
|
||||
} catch (e) {
|
||||
// The only remaining case that isn't support is a relative file path that should be
|
||||
// resolved using a relative file location. Accessing local file paths can lead to
|
||||
// path traversal attacks and access to any file on the host system. Implementing this
|
||||
// would require additional security measures.
|
||||
throw new Error(
|
||||
`Placeholder \$${key} could not form a URL out of ${baseUrl} and ${value}`,
|
||||
`Placeholder \$${key} could not form a URL out of ${baseUrl} and ${value}, ${e}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user