@@ -11,25 +11,24 @@ const handleCliError = (error, opts) => {
1111 const errorA = normalizeException ( error )
1212 const {
1313 error : errorB ,
14- opts : { silent, exitCode, timeout } ,
14+ opts : { silent, exitCode, timeout, log } ,
1515 beautifulErrorOpts,
1616 } = getOpts ( errorA , opts )
1717
18- printError ( errorB , silent , beautifulErrorOpts )
18+ printError ( { error : errorB , silent, log , beautifulErrorOpts } )
1919 exitProcess ( exitCode , timeout )
2020}
2121
2222// We pass the `error` instance to `console.error()`, so it prints not only its
2323// `message` and `stack` but also its properties, `cause`, aggregate `errors`,
2424// add colors, inline preview, etc. using `util.inspect()`
25- const printError = ( error , silent , beautifulErrorOpts ) => {
25+ const printError = ( { error, silent, log , beautifulErrorOpts } ) => {
2626 if ( silent ) {
2727 return
2828 }
2929
3030 const errorString = beautifulError ( error , beautifulErrorOpts )
31- // eslint-disable-next-line no-restricted-globals, no-console
32- console . error ( errorString )
31+ log ( errorString )
3332}
3433
3534export default handleCliError
0 commit comments