[#191] Refactor error handling and logging
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
0f73da258b
commit
458bf933fc
17 changed files with 327 additions and 398 deletions
|
@ -724,12 +724,12 @@ func (a *app) stopServices() {
|
|||
}
|
||||
|
||||
func (a *app) configureRouter(workerPool *ants.Pool) {
|
||||
a.handle = handler.New(a.AppParams(), a.settings, tree.NewTree(frostfs.NewPoolWrapper(a.treePool)), workerPool)
|
||||
a.handle = handler.New(a.AppParams(), a.settings, tree.NewTree(frostfs.NewPoolWrapper(a.treePool), a.log), workerPool)
|
||||
|
||||
r := router.New()
|
||||
r.RedirectTrailingSlash = true
|
||||
r.NotFound = func(r *fasthttp.RequestCtx) {
|
||||
handler.ResponseError(r, "Not found", fasthttp.StatusNotFound)
|
||||
handler.ResponseError(r, "Route Not found", fasthttp.StatusNotFound)
|
||||
}
|
||||
r.MethodNotAllowed = func(r *fasthttp.RequestCtx) {
|
||||
handler.ResponseError(r, "Method Not Allowed", fasthttp.StatusMethodNotAllowed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue