File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export function Handler(method?: HttpVerb): MethodDecorator {
8080
8181 const returnValue = await originalHandler . call ( this , ...parameters ) ;
8282
83- if ( returnValue instanceof ServerResponse ) {
83+ if ( returnValue instanceof ServerResponse || res . headersSent ) {
8484 return ;
8585 }
8686
@@ -92,8 +92,6 @@ export function Handler(method?: HttpVerb): MethodDecorator {
9292 res . json ( returnValue ?? null ) ;
9393 }
9494 } catch ( err ) {
95- console . error ( err ) ;
96-
9795 const statusCode = err instanceof HttpException ? err . statusCode : 500 ;
9896 const message = err instanceof HttpException ? err . message : 'An unknown error occurred.' ;
9997 const errors = err instanceof HttpException && err . errors ?. length ? err . errors : [ message ] ;
You can’t perform that action at this time.
0 commit comments