worker/client: expose server errors

The worker API returns errors of the form:

  { "message": "..." }

Print the message of those errors when receiving an error on the client.

This adds an `Error` type to openapi.yml and marks all routes as
returning it on 4XX and 5XX.
This commit is contained in:
Lars Karlitski 2020-09-09 10:23:08 +02:00 committed by Tom Gundersen
parent 3bedd25087
commit ca35f25fcf
4 changed files with 80 additions and 13 deletions

View file

@ -10,6 +10,11 @@ import (
"net/http"
)
// Error defines model for Error.
type Error struct {
Message string `json:"message"`
}
// RequestJobJSONBody defines parameters for RequestJob.
type RequestJobJSONBody map[string]interface{}