Fix logic of marking task as failed (#3083)

* Fix logic of markaing task as failed
- Do not mark task as failed if it is already in the shutting down state
- accumulate errors when setting task error to understand the context
- refactor the Error record

* fix tests

* format

* Fix build

* Update src/ApiService/ApiService/onefuzzlib/ImageReference.cs

Co-authored-by: George Pollard <porges@porg.es>

* Update src/ApiService/ApiService/onefuzzlib/ProxyOperations.cs

Co-authored-by: Teo Voinea <58236992+tevoinea@users.noreply.github.com>

---------

Co-authored-by: George Pollard <porges@porg.es>
Co-authored-by: Teo Voinea <58236992+tevoinea@users.noreply.github.com>
This commit is contained in:
Cheick Keita
2023-05-04 12:50:46 -07:00
committed by GitHub
parent d237563988
commit bb1a54470a
36 changed files with 171 additions and 216 deletions

View File

@ -36,9 +36,9 @@ sealed class TestEndpointAuthorization : EndpointAuthorization {
return _context.RequestHandling.NotOk(
req,
new Error(
Error.Create(
ErrorCode.UNAUTHORIZED,
new string[] { "Unrecognized agent" }
"Unrecognized agent"
),
"token verification",
HttpStatusCode.Unauthorized