Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Commit

Permalink
fix: strip ansi from context
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 28, 2018
1 parent 589e18a commit 5523431
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as clean from 'clean-stack'
import * as extract from 'extract-stack'
import indent = require('indent-string')
import * as _ from 'lodash'
import stripAnsi = require('strip-ansi')
import {inspect} from 'util'

import CLI from '.'
Expand Down Expand Up @@ -59,7 +60,7 @@ export function getErrorMessage(err: any, opts: {stack?: boolean} = {}): string
// Unhandled error
if (err.message) message = err.message
if (context && !_.isEmpty(context)) {
message += '\n' + indent(styledObject(err['cli-ux'].context), 4)
message += '\n' + stripAnsi(indent(styledObject(err['cli-ux'].context), 4))
}
message = message || inspect(err)

Expand Down

0 comments on commit 5523431

Please sign in to comment.