Files
cypress/packages/server/lib/errors.ts
Kukhyeon Heo 0aa89fa5b3 chore: add check-ts command to pkg/driver (#22912)
Co-authored-by: Blue F <blue@everblue.info>
Co-authored-by: Rachel <Raquel.rudermano@gmail.com>
Co-authored-by: Rachel <rachel@cypress.io>
2022-08-15 09:46:24 -05:00

33 lines
708 B
TypeScript

import Bluebird from 'bluebird'
import errors from '@packages/errors'
import exception from './exception'
const isProduction = () => {
return process.env['CYPRESS_INTERNAL_ENV'] === 'production'
}
export const logException = Bluebird.method(function (this: any, err) {
// TODO: remove context here
if (this.log(err) && isProduction()) {
// log this exception since
// its not a known error
return exception
.create(err)
.catch(() => {})
}
return
})
export const get = errors.get
export const log = errors.log
export const warning = errors.warning
export const throwErr = errors.throwErr
export const cloneErr = errors.cloneErr
export const stripAnsi = errors.stripAnsi