response lifecycle timeout and route handling

This commit is contained in:
2021-03-08 12:34:31 -06:00
parent 9747d40659
commit 4ecada6be8
11 changed files with 92 additions and 19 deletions

View File

@@ -1,9 +1,10 @@
import {Instantiable, Singleton, Inject} from "@extollo/di"
import {Collection} from "@extollo/util"
import {Inject, Instantiable, Singleton} from "@extollo/di"
import {Collection, HTTPStatus} from "@extollo/util"
import {HTTPKernelModule} from "./HTTPKernelModule";
import {Logging} from "../../service/Logging";
import {AppClass} from "../../lifecycle/AppClass";
import {Request} from "../lifecycle/Request";
import {http} from "../response/HTTPErrorResponseFactory";
/**
* Interface for fluently registering kernel modules into the kernel.
@@ -72,11 +73,10 @@ export class HTTPKernel extends AppClass {
}
} catch (e: any) {
this.logging.error(e)
// FIXME handle error response
// const error_response = error(e)
// await error_response.write(request)
await http(HTTPStatus.REQUEST_TIMEOUT).write(request)
}
this.logging.verbose('Finished kernel lifecycle')
return request
}