worker: clarify 404 error message

When a token doesn't exist, the URL is invalid. Nothing to do with a
job.
This commit is contained in:
Lars Karlitski 2020-09-11 12:36:09 +02:00 committed by Tom Gundersen
parent ca35f25fcf
commit 85423d403c

View file

@ -279,7 +279,7 @@ func (h *apiHandlers) GetJob(ctx echo.Context, tokenstr string) error {
if err != nil {
switch err {
case ErrTokenNotExist:
return echo.NewHTTPError(http.StatusNotFound, "job is not running")
return echo.NewHTTPError(http.StatusNotFound, "not found")
default:
return err
}
@ -322,7 +322,7 @@ func (h *apiHandlers) UpdateJob(ctx echo.Context, idstr string) error {
if err != nil {
switch err {
case ErrTokenNotExist:
return echo.NewHTTPError(http.StatusNotFound, "job does not exist")
return echo.NewHTTPError(http.StatusNotFound, "not found")
default:
return err
}