From a1f0169edfdd42fa07b42150fa0d50d89aed3d73 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Tue, 15 Jan 2019 22:00:46 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20500=20error=20for=20cont?= =?UTF-8?q?ent=20with=20no=20collection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- core/server/services/url/UrlService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/services/url/UrlService.js b/core/server/services/url/UrlService.js index a9a4df7da7..f8fe710c7f 100644 --- a/core/server/services/url/UrlService.js +++ b/core/server/services/url/UrlService.js @@ -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' });