only set the code to 200 if no error exists

This commit is contained in:
Alfred Kamanda 2024-09-18 15:11:49 +03:00
parent a9a429824c
commit 27aa71e0ee
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -44,14 +44,12 @@ func (ash *ATSessionHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
rqs, err = ash.Process(rqs)
switch err {
case handlers.ErrStorage:
code = 500
case handlers.ErrEngineInit:
code = 500
case handlers.ErrEngineExec:
case nil: // set code to 200 if no err
code = 200
case handlers.ErrStorage, handlers.ErrEngineInit, handlers.ErrEngineExec, handlers.ErrEngineType:
code = 500
default:
code = 200
code = 500
}
if code != 200 {