diff --git a/libs/fetcher.js b/libs/fetcher.js index a75c98e9..9e31421f 100644 --- a/libs/fetcher.js +++ b/libs/fetcher.js @@ -101,14 +101,14 @@ function parseParamValues (params) { params: parseParamValues(qs.parse(path.join('&'))), config: {}, callback: function (err, data, meta) { - if (err) { - res.status(err.statusCode || 400).send(err.message || 'request failed'); - return; - } meta = meta || {}; if (meta.headers) { res.set(meta.headers); } + if (err) { + res.status(err.statusCode || 400).send(err.message || 'request failed'); + return; + } res.status(meta.statusCode || 200).json(data); } };