|
|
@ -1,5 +1,5 @@
|
|
|
|
import {Inject, Singleton} from '../di'
|
|
|
|
import {Inject, Singleton} from '../di'
|
|
|
|
import {HTTPStatus, withTimeout} from '../util'
|
|
|
|
import {ErrorWithContext, HTTPStatus, withTimeout} from '../util'
|
|
|
|
import {Unit} from '../lifecycle/Unit'
|
|
|
|
import {Unit} from '../lifecycle/Unit'
|
|
|
|
import {createServer, IncomingMessage, RequestListener, Server, ServerResponse} from 'http'
|
|
|
|
import {createServer, IncomingMessage, RequestListener, Server, ServerResponse} from 'http'
|
|
|
|
import {Logging} from './Logging'
|
|
|
|
import {Logging} from './Logging'
|
|
|
@ -114,9 +114,13 @@ export class HTTPServer extends Unit {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
await this.kernel.handle(extolloReq)
|
|
|
|
await this.kernel.handle(extolloReq)
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
if ( e instanceof Error ) {
|
|
|
|
await error(e).write(extolloReq)
|
|
|
|
await error(e).write(extolloReq)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await error(new ErrorWithContext('Unknown error occurred.', { e }))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await extolloReq.response.send()
|
|
|
|
await extolloReq.response.send()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|