🐛 Fixed 500 error for content with no collection

no issue

- Fixes a case where a post that doesn't belong to a collection throws a 500 Resource Not Found Error
- This should be a 404 Resource Not Found error
- 500 suggests something went very wrong and is our fault,
-  but this is a user error where the collections or posts are misconfigured, and some content doesn't have a home
This commit is contained in:
Hannah Wolfe 2019-01-15 22:00:46 +00:00
parent 846a94728f
commit a1f0169edf

View File

@ -137,7 +137,7 @@ class UrlService {
const object = this.urls.getByResourceId(resourceId);
if (!object) {
throw new common.errors.InternalServerError({
throw new common.errors.NotFoundError({
message: 'Resource not found.',
code: 'URLSERVICE_RESOURCE_NOT_FOUND'
});