This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {Inject, Singleton} from '../di'
|
||||
import {HTTPStatus, withTimeout} from '../util'
|
||||
import {ErrorWithContext, HTTPStatus, withTimeout} from '../util'
|
||||
import {Unit} from '../lifecycle/Unit'
|
||||
import {createServer, IncomingMessage, RequestListener, Server, ServerResponse} from 'http'
|
||||
import {Logging} from './Logging'
|
||||
@@ -114,7 +114,11 @@ export class HTTPServer extends Unit {
|
||||
try {
|
||||
await this.kernel.handle(extolloReq)
|
||||
} catch (e) {
|
||||
await error(e).write(extolloReq)
|
||||
if ( e instanceof Error ) {
|
||||
await error(e).write(extolloReq)
|
||||
}
|
||||
|
||||
await error(new ErrorWithContext('Unknown error occurred.', { e }))
|
||||
}
|
||||
|
||||
await extolloReq.response.send()
|
||||
|
||||
Reference in New Issue
Block a user