File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ const translate = async (
389389 ncp (
390390 evaluateFilePath ( workingDir , dirStructure , sourceLang ) ,
391391 evaluateFilePath ( resolvedCacheDir , dirStructure , sourceLang ) ,
392- ( err ) => ( err ? rej ( ) : res ( null ) ) ,
392+ ( err ) => ( err ? rej ( err ) : res ( null ) ) ,
393393 ) ,
394394 ) ;
395395 console . log ( chalk `└── {green.bold Translation files have been cached.}` ) ;
@@ -441,11 +441,17 @@ translate(
441441 commander . appName ,
442442 commander . context ,
443443 commander . overwrite ,
444- ) . catch ( ( e : Error ) => {
444+ ) . catch ( ( e : unknown ) => {
445445 console . log ( ) ;
446446 console . log ( chalk . bgRed ( 'An error has occurred:' ) ) ;
447- console . log ( chalk . bgRed ( e . message ) ) ;
448- console . log ( chalk . bgRed ( e . stack ) ) ;
447+ if ( e instanceof Error ) {
448+ console . log ( chalk . bgRed ( e . message ) ) ;
449+ if ( e . stack ) {
450+ console . log ( chalk . bgRed ( e . stack ) ) ;
451+ }
452+ } else {
453+ console . log ( chalk . bgRed ( String ( e ) ) ) ;
454+ }
449455 console . log ( ) ;
450456 process . exit ( 1 ) ;
451457} ) ;
You can’t perform that action at this time.
0 commit comments