File tree Expand file tree Collapse file tree 2 files changed +31
-13
lines changed Expand file tree Collapse file tree 2 files changed +31
-13
lines changed Original file line number Diff line number Diff line change @@ -193,13 +193,20 @@ export async function _watch(
193193 }
194194 running = true ;
195195
196- run ( ) . finally ( ( ) => {
197- running = false ;
198- if ( runAgain ) {
199- runAgain = false ;
200- queue ( ) ;
201- }
202- } ) ;
196+ run ( )
197+ . catch ( e => {
198+ if ( ! e [ "_gmlogged" ] ) {
199+ // eslint-disable-next-line no-console
200+ console . error ( e ) ;
201+ }
202+ } )
203+ . finally ( ( ) => {
204+ running = false ;
205+ if ( runAgain ) {
206+ runAgain = false ;
207+ queue ( ) ;
208+ }
209+ } ) ;
203210 } ;
204211 const watcher = chokidar . watch ( currentLocation . path , {
205212 /*
Original file line number Diff line number Diff line change @@ -59,20 +59,31 @@ export async function runQueryWithErrorInstrumentation(
5959}
6060
6161export const logDbError = ( e : Error ) : void => {
62+ /* eslint-disable no-console */
6263 e [ "_gmlogged" ] = true ;
63- // eslint-disable-next-line no-console
6464 console . error ( "" ) ;
6565 if ( e [ "_gmMessageOverride" ] ) {
66- // eslint-disable-next-line no-console
6766 console . error ( e [ "_gmMessageOverride" ] ) ;
6867 } else {
69- // eslint-disable-next-line no-console
7068 console . error (
7169 chalk . red . bold ( `🛑 Error occurred whilst processing migration` ) ,
7270 ) ;
73- // eslint-disable-next-line no-console
74- console . error ( indent ( e . stack ? e . stack : e . message , 4 ) ) ;
7571 }
76- // eslint-disable-next-line no-console
72+ const { severity, code, detail, hint } = e as any ;
73+ console . error ( indent ( e . stack ? e . stack : e . message , 4 ) ) ;
7774 console . error ( "" ) ;
75+ if ( severity ) {
76+ console . error ( indent ( `Severity:\t${ severity } ` , 4 ) ) ;
77+ }
78+ if ( code ) {
79+ console . error ( indent ( `Code: \t${ code } ` , 4 ) ) ;
80+ }
81+ if ( detail ) {
82+ console . error ( indent ( `Detail: \t${ detail } ` , 4 ) ) ;
83+ }
84+ if ( hint ) {
85+ console . error ( indent ( `Hint: \t${ hint } ` , 4 ) ) ;
86+ }
87+ console . error ( "" ) ;
88+ /* eslint-enable */
7889} ;
You can’t perform that action at this time.
0 commit comments