[#155] Fix error handling

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2021-07-14 19:06:24 +03:00
parent 1ecf32c302
commit f2eeed0b85
3 changed files with 3 additions and 15 deletions

View file

@ -119,7 +119,7 @@ var s3ErrorResponseMap = map[string]string{
// WriteErrorResponse writes error headers.
func WriteErrorResponse(ctx context.Context, w http.ResponseWriter, err error, reqURL *url.URL) {
code := http.StatusBadRequest
code := http.StatusInternalServerError
if e, ok := err.(Error); ok {
code = e.HTTPStatusCode