Conditional prod/dev in own error handler


#1

Hi,

I have own ErrorHandler extends IonicErrorHandler. How can I do conditional if app run in dev (ionic serve) or production (ios or android)

There is my handler

import { IonicErrorHandler } from 'ionic-angular'
import Raven from 'raven-js'

Raven.config('***').install()

export class SentryErrorHandler extends IonicErrorHandler {

    handleError(error) {
        super.handleError(error)
        try {
          if (con){ //There is the conditional - need run only in production
            Raven.captureException(error.originalError || error)
          }
        }
        catch(e) {
          console.error(e)
        }
    }
}

Thanks for answer