Properly handle error and improve error messages

This commit is contained in:
2024-09-21 11:26:25 +07:00
parent 557e7313b2
commit bcdcbd5049
25 changed files with 258 additions and 234 deletions

View File

@ -36,8 +36,8 @@ func PUT(w http.ResponseWriter, r *http.Request) {
existingChunks, err := app.Server.Storage.ListObjects(r.Context(), prefix)
if err != nil {
app.Server.Logger.Error(err.Error())
w.WriteHeader(http.StatusInternalServerError)
app.Server.Logger.Error(err.Error())
return
}
@ -55,6 +55,7 @@ func PUT(w http.ResponseWriter, r *http.Request) {
err = component.Render(r.Context(), w)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
app.Server.Logger.Error(err.Error())
return
}
}