From dd082ad345e963e1b558ee4872fee7ccd8fdbc58 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 2 Aug 2021 10:25:18 +0100 Subject: [PATCH] return a 409 for DocModified errors --- services/docstore/app.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/docstore/app.js b/services/docstore/app.js index 931914e0f5..75154471be 100644 --- a/services/docstore/app.js +++ b/services/docstore/app.js @@ -91,6 +91,8 @@ app.use(function (error, req, res, next) { logger.error({ err: error, req }, 'request errored') if (error instanceof Errors.NotFoundError) { return res.sendStatus(404) + } else if (error instanceof Errors.DocModifiedError) { + return res.sendStatus(409) } else { return res.status(500).send('Oops, something went wrong') }