mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
change: Clarify parent error message.
This commit is contained in:
parent
535cbcd93a
commit
357546e90f
@ -53,7 +53,7 @@ export const getParentContainer = (id: ResourceIdentifier): ResourceIdentifier =
|
|||||||
|
|
||||||
// This probably means there is an issue with the root
|
// This probably means there is an issue with the root
|
||||||
if (parentPath === id.path) {
|
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 };
|
return { path: parentPath };
|
||||||
|
@ -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<void> => {
|
it('errors when the root of an URl is reached that does not match the input root.', async(): Promise<void> => {
|
||||||
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');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user