fix(api): error reporter should have explicit env check (#38000)
This commit is contained in:
@ -27,7 +27,8 @@ ${JSON.stringify(error, null, 2)}
|
||||
};
|
||||
|
||||
export function reportError(err) {
|
||||
return process.env.FREECODECAMP_NODE_ENV === 'production'
|
||||
return process.env.FREECODECAMP_NODE_ENV === 'production' &&
|
||||
process.env.ERROR_REPORTER === 'true'
|
||||
? reporter.error(err.message, err)
|
||||
: console.error(err);
|
||||
}
|
||||
@ -35,7 +36,7 @@ export function reportError(err) {
|
||||
export default function errrorReporter() {
|
||||
if (
|
||||
process.env.FREECODECAMP_NODE_ENV !== 'production' &&
|
||||
process.env.ERROR_REPORTER
|
||||
process.env.ERROR_REPORTER === 'true'
|
||||
) {
|
||||
return (err, req, res, next) => {
|
||||
console.error(errTemplate(err, req));
|
||||
|
Reference in New Issue
Block a user