fix: report error only when enabled

pull/17187/head
Mrugesh Mohapatra 2018-05-19 01:41:44 +05:30
parent 8b0cec8678
commit c2a0443486
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ const log = debug('fcc:middlewares:error-reporter');
const isOpbeatDisabled = !opbeat.appId;
export default function errrorReporter() {
if (process.env.NODE_ENV !== 'production') {
if (process.env.NODE_ENV !== 'production' && process.env.ERROR_REPORTER) {
return (err, req, res, next) => {
if (isHandledError(err)) {
// log out user messages in development