Skip to content

Commit

Permalink
fix(core): using is_production for hiding debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
allardy committed Aug 27, 2019
1 parent 8c81ee8 commit daba068
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/bp/core/server.ts
Expand Up @@ -53,7 +53,6 @@ import { TYPES } from './types'

const BASE_API_PATH = '/api/v1'
const SERVER_USER_STRATEGY = 'default' // The strategy isn't validated for the userver user, it could be anything.
const isProd = process.env.NODE_ENV === 'production'

const debug = DEBUG('api')
const debugRequest = debug.sub('request')
Expand Down Expand Up @@ -285,7 +284,7 @@ export default class HTTPServer {
const errorCode = err.errorCode || 'BP_000'
const message = (err.errorCode && err.message) || 'Unexpected error'
const docs = err.docs || 'https://botpress.io/docs'
const devOnly = isProd ? {} : { showStackInDev: true, stack: err.stack, full: err.message }
const devOnly = process.IS_PRODUCTION ? {} : { showStackInDev: true, stack: err.stack, full: err.message }

res.status(statusCode).json({
statusCode,
Expand Down

0 comments on commit daba068

Please sign in to comment.