Skip to content

Commit

Permalink
fix: backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Jan 8, 2024
1 parent 081b441 commit b4a574d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/cli/exit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import debug from 'debug';
import env from '../../lib/env';

export function withError( message: Error | string ): never {
console.error( `${ red( 'Error: ' ) } ${ message.toString().replace( /^Error:\s*/, '' ) }` );
const msg = message instanceof Error ? message.message : message;
console.error( `${ red( 'Error: ' ) } ${ msg.replace( /^Error:\s*/, '' ) }` );

// Debug ouput is printed below error output both for information
// hierarchy and to make it more likely that the user copies it to their
Expand Down

0 comments on commit b4a574d

Please sign in to comment.