Removes second log when responding with a regular error
This commit is contained in:
@@ -181,7 +181,7 @@ function makeExpressHandler(appId, promiseHandler) {
|
||||
})
|
||||
}
|
||||
res.json(result.response);
|
||||
}, (e) => {
|
||||
}, (error) => next(error)).catch((e) => {
|
||||
log.error(`Error generating response. ${inspect(e)}`, {error: e});
|
||||
next(e);
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import AppCache from './cache';
|
||||
import log from './logger';
|
||||
import Parse from 'parse/node';
|
||||
import auth from './Auth';
|
||||
import Config from './Config';
|
||||
import ClientSDK from './ClientSDK';
|
||||
import defaultLogger from './logger';
|
||||
|
||||
// Checks that the request is authorized for this app and checks user
|
||||
// auth too.
|
||||
@@ -179,7 +179,7 @@ export function handleParseHeaders(req, res, next) {
|
||||
}
|
||||
else {
|
||||
// TODO: Determine the correct error scenario.
|
||||
log.error('error getting auth for sessionToken', error);
|
||||
req.config.loggerController.error('error getting auth for sessionToken', error);
|
||||
throw new Parse.Error(Parse.Error.UNKNOWN_ERROR, error);
|
||||
}
|
||||
});
|
||||
@@ -267,6 +267,7 @@ export function allowMethodOverride(req, res, next) {
|
||||
}
|
||||
|
||||
export function handleParseErrors(err, req, res, next) {
|
||||
const log = (req.config && req.config.loggerController) || defaultLogger;
|
||||
if (err instanceof Parse.Error) {
|
||||
let httpStatus;
|
||||
// TODO: fill out this mapping
|
||||
|
||||
Reference in New Issue
Block a user