diff --git a/src/util/PathUtil.ts b/src/util/PathUtil.ts index fda439ae5..f0cbc2455 100644 --- a/src/util/PathUtil.ts +++ b/src/util/PathUtil.ts @@ -53,7 +53,7 @@ export const getParentContainer = (id: ResourceIdentifier): ResourceIdentifier = // This probably means there is an issue with the root if (parentPath === id.path) { - throw new InternalServerError('URL root reached'); + throw new InternalServerError(`Resource ${id.path} does not have a parent container`); } return { path: parentPath }; diff --git a/test/unit/util/PathUtil.test.ts b/test/unit/util/PathUtil.test.ts index 30e090aad..e319b11d5 100644 --- a/test/unit/util/PathUtil.test.ts +++ b/test/unit/util/PathUtil.test.ts @@ -37,7 +37,8 @@ describe('PathUtil', (): void => { }); it('errors when the root of an URl is reached that does not match the input root.', async(): Promise => { - expect((): any => getParentContainer({ path: 'http://test.com/' })).toThrow('URL root reached'); + expect((): any => getParentContainer({ path: 'http://test.com/' })) + .toThrow('Resource http://test.com/ does not have a parent container'); }); }); });