diff --git a/core/server/api/shared/http.js b/core/server/api/shared/http.js index 21f5e67900..c83c359b5c 100644 --- a/core/server/api/shared/http.js +++ b/core/server/api/shared/http.js @@ -79,8 +79,12 @@ const http = (apiImpl, apiType) => { debug('json response'); res.json(result || {}); }) - .catch(({err, docName, method}) => { - req.frameOptions = {docName, method}; + .catch((err) => { + req.frameOptions = { + docName: frame.docName, + method: frame.method + }; + next(err); }); }; diff --git a/core/server/api/shared/pipeline.js b/core/server/api/shared/pipeline.js index 38803d0087..ab91199700 100644 --- a/core/server/api/shared/pipeline.js +++ b/core/server/api/shared/pipeline.js @@ -138,6 +138,9 @@ const pipeline = (apiController, apiUtils) => { return apiImpl(frame); } + frame.docName = docName; + frame.method = method; + return Promise.resolve() .then(() => { return STAGES.validation.input(apiUtils, apiConfig, apiImpl, frame); @@ -156,9 +159,6 @@ const pipeline = (apiController, apiUtils) => { }) .then(() => { return frame.response; - }) - .catch((err) => { - throw {err, docName, method}; }); };