Merge pull request #70 from versity/ben/internal_error_log

feat: add log for internal server errors not of type s3err.APIError
This commit is contained in:
Ben McClelland
2023-06-12 07:15:16 -07:00
committed by GitHub

View File

@@ -21,6 +21,7 @@ import (
"fmt"
"io"
"net/http"
"os"
"strconv"
"strings"
"time"
@@ -396,6 +397,10 @@ func Responce[R comparable](ctx *fiber.Ctx, resp R, err error) error {
ctx.Status(serr.HTTPStatusCode)
return ctx.Send(s3err.GetAPIErrorResponse(serr, "", "", ""))
}
fmt.Fprintf(os.Stderr, "Internal Error, req:\n%v\nerr:\n%v\n",
ctx.Request(), err)
return ctx.Send(s3err.GetAPIErrorResponse(
s3err.GetAPIError(s3err.ErrInternalError), "", "", ""))
}