File tree 2 files changed +31
-13
lines changed
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(
193
193
}
194
194
running = true ;
195
195
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
+ } ) ;
203
210
} ;
204
211
const watcher = chokidar . watch ( currentLocation . path , {
205
212
/*
Original file line number Diff line number Diff line change @@ -59,20 +59,31 @@ export async function runQueryWithErrorInstrumentation(
59
59
}
60
60
61
61
export const logDbError = ( e : Error ) : void => {
62
+ /* eslint-disable no-console */
62
63
e [ "_gmlogged" ] = true ;
63
- // eslint-disable-next-line no-console
64
64
console . error ( "" ) ;
65
65
if ( e [ "_gmMessageOverride" ] ) {
66
- // eslint-disable-next-line no-console
67
66
console . error ( e [ "_gmMessageOverride" ] ) ;
68
67
} else {
69
- // eslint-disable-next-line no-console
70
68
console . error (
71
69
chalk . red . bold ( `🛑 Error occurred whilst processing migration` ) ,
72
70
) ;
73
- // eslint-disable-next-line no-console
74
- console . error ( indent ( e . stack ? e . stack : e . message , 4 ) ) ;
75
71
}
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 ) ) ;
77
74
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 */
78
89
} ;
You can’t perform that action at this time.
0 commit comments