diff --git a/src/services/resource-updater.js b/src/services/resource-updater.js index 5abe66a1..5dfb7546 100644 --- a/src/services/resource-updater.js +++ b/src/services/resource-updater.js @@ -1,4 +1,5 @@ import { scopeManager } from 'forest-express'; +import createError from 'http-errors'; import { ErrorHTTP422 } from './errors'; import QueryOptions from './query-options'; import ResourceGetter from './resource-getter'; @@ -29,6 +30,8 @@ class ResourceUpdater { } catch (error) { throw new ErrorHTTP422(error.message); } + } else { + throw createError(404, `The ${this._model.name} #${this._params.recordId} does not exist.`); } try {