File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,21 +30,20 @@ function fastbootExpressMiddleware(distPath, options) {
3030
3131 try {
3232 let result = await fastboot . visit ( path , { request : req , response : res } ) ;
33- let responseBody = opts . chunkedResponse ? result . chunks ( ) : result . html ( ) ;
33+ let body = opts . chunkedResponse ? await result . chunks ( ) : await result . html ( ) ;
34+
35+ if ( result . error ) {
36+ log ( 'RESILIENT MODE CAUGHT:' , result . error . stack ) ;
37+ next ( result . error ) ;
38+ }
3439
35- let body = await responseBody ;
3640 let headers = result . headers ;
3741 let statusMessage = result . error ? 'NOT OK ' : 'OK ' ;
3842
3943 for ( var pair of headers . entries ( ) ) {
4044 res . append ( pair [ 0 ] , pair [ 1 ] ) ;
4145 }
4246
43- if ( result . error ) {
44- log ( 'RESILIENT MODE CAUGHT:' , result . error . stack ) ;
45- next ( result . error ) ;
46- }
47-
4847 log ( result . statusCode , statusMessage + path ) ;
4948 res . status ( result . statusCode ) ;
5049
You can’t perform that action at this time.
0 commit comments