fix: Use module.exports instead of export default

This commit is contained in:
Blade Barringer
2016-03-04 13:29:51 -06:00
parent 4cd0428f0a
commit b97511db31
34 changed files with 53 additions and 53 deletions

View File

@@ -8,7 +8,7 @@ import {
} from '../../libs/api-v3/errors';
import { map } from 'lodash';
export default function errorHandler (err, req, res, next) { // eslint-disable-line no-unused-vars
module.exports = function errorHandler (err, req, res, next) { // eslint-disable-line no-unused-vars
// Log the original error with some metadata
let stack = err.stack || err.message || err;
@@ -77,4 +77,4 @@ export default function errorHandler (err, req, res, next) { // eslint-disable-l
// In some occasions like when invalid JSON is supplied `res.respond` might be not yet avalaible,
// in this case we use the standard res.status(...).json(...)
return res.respond ? res.respond(responseErr.httpCode, jsonRes) : res.status(responseErr.httpCode).json(jsonRes);
}
};