feat: add log for internal server errors not of type s3err.APIError

This commit is contained in:
Ben McClelland
2023-06-09 10:35:21 -07:00
parent 160a99cbbd
commit 50357ce61a
+5
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), "", "", ""))
}