Skip to content

Commit

Permalink
api: return 400 if we can't extract a layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-M committed Feb 9, 2016
1 parent 343ce39 commit e8b1617
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"net/http"

"github.com/coreos/clair/database"
"github.com/coreos/clair/utils"
cerrors "github.com/coreos/clair/utils/errors"
"github.com/coreos/clair/worker"
)
Expand Down Expand Up @@ -55,7 +56,7 @@ func WriteHTTPError(w http.ResponseWriter, httpStatus int, err error) {
httpStatus = http.StatusNotFound
case database.ErrTransaction, database.ErrBackendException:
httpStatus = http.StatusServiceUnavailable
case worker.ErrParentUnknown, worker.ErrUnsupported:
case worker.ErrParentUnknown, worker.ErrUnsupported, utils.ErrCouldNotExtract, utils.ErrExtractedFileTooBig:
httpStatus = http.StatusBadRequest
}
}
Expand Down

0 comments on commit e8b1617

Please sign in to comment.