Commit edab4d6
Aryan Tiwari
·
2026-03-03 21:57:00 -0500 EST
parent b5271f2
Chore: Unified Error Logs throughout the repo (#210)
5 files changed,
+8,
-8
+2,
-2
| ... | ... | @@ -467,9 +467,9 @@ func paymentWebhookHandler(apiConfig *router.ApiConfig) http.HandlerFunc { | |
| 467 | 467 | w.Header().Add("content-type", "text/plain") | |
| 468 | 468 | ||
| 469 | 469 | if err != nil { | |
| 470 | - | logger.Error("error reading request body", "err", err.Error()) | |
| 470 | + | logger.Error("ERROR: reading request body", "err", err.Error()) | |
| 471 | 471 | w.WriteHeader(http.StatusOK) | |
| 472 | - | _, _ = fmt.Fprintf(w, "error reading request body %s", err.Error()) | |
| 472 | + | _, _ = fmt.Fprintf(w, "ERROR: reading request body %s", err.Error()) | |
| 473 | 473 | return | |
| 474 | 474 | } | |
| 475 | 475 |
+2,
-2
| ... | ... | @@ -437,8 +437,8 @@ func (web *WebRouter) ImageRequest(perm func(proj *db.Project) bool) http.Handle | |
| 437 | 437 | ||
| 438 | 438 | opts, err := storage.UriToImgProcessOpts(imgOpts) | |
| 439 | 439 | if err != nil { | |
| 440 | - | errMsg := fmt.Sprintf("error processing img options: %s", err.Error()) | |
| 441 | - | web.Cfg.Logger.Error("error processing img options", "err", errMsg) | |
| 440 | + | errMsg := fmt.Sprintf("ERROR: error processing img options: %s", err.Error()) | |
| 441 | + | web.Cfg.Logger.Error("ERROR: processing img options", "err", errMsg) | |
| 442 | 442 | http.Error(w, errMsg, http.StatusUnprocessableEntity) | |
| 443 | 443 | return | |
| 444 | 444 | } |
+1,
-1
| ... | ... | @@ -192,7 +192,7 @@ func Middleware(handler *CliHandler) pssh.SSHServerMiddleware { | |
| 192 | 192 | user, err := getUser(sesh, dbpool) | |
| 193 | 193 | if err != nil { | |
| 194 | 194 | _, _ = fmt.Fprintf(sesh.Stderr(), "detected ssh command: %s\n", args) | |
| 195 | - | s := fmt.Errorf("error: you need to create an account before using the remote cli: %w", err) | |
| 195 | + | s := fmt.Errorf("ERROR: you need to create an account before using the remote cli: %w", err) | |
| 196 | 196 | sesh.Fatal(s) | |
| 197 | 197 | return s | |
| 198 | 198 | } |
+2,
-2
| ... | ... | @@ -188,7 +188,7 @@ func Middleware(writeHandler utils.CopyFromClientHandler) pssh.SSHServerMiddlewa | |
| 188 | 188 | defer func() { | |
| 189 | 189 | if r := recover(); r != nil { | |
| 190 | 190 | logger.Error("error running rsync middleware", "err", r) | |
| 191 | - | _, _ = session.Stderr().Write([]byte("error running rsync middleware, check the flags you are using\r\n")) | |
| 191 | + | _, _ = session.Stderr().Write([]byte("ERROR: error running rsync middleware, check the flags you are using\r\n")) | |
| 192 | 192 | } | |
| 193 | 193 | }() | |
| 194 | 194 |
| ... | ... | @@ -201,7 +201,7 @@ func Middleware(writeHandler utils.CopyFromClientHandler) pssh.SSHServerMiddlewa | |
| 201 | 201 | ||
| 202 | 202 | optsCtx, err := rsyncopts.ParseArguments(cmdFlags[1:], true) | |
| 203 | 203 | if err != nil { | |
| 204 | - | _, _ = fmt.Fprintf(session.Stderr(), "error parsing rsync arguments: %s\r\n", err.Error()) | |
| 204 | + | _, _ = fmt.Fprintf(session.Stderr(), "ERROR: error parsing rsync arguments: %s\r\n", err.Error()) | |
| 205 | 205 | return err | |
| 206 | 206 | } | |
| 207 | 207 |
+1,
-1
| ... | ... | @@ -183,7 +183,7 @@ func (m *AccessLogsPage) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) { | |
| 183 | 183 | ah += int(brdSurf.Size.Height) | |
| 184 | 184 | ||
| 185 | 185 | if err != nil { | |
| 186 | - | txt := text.New(fmt.Sprintf("Error: %s", err.Error())) | |
| 186 | + | txt := text.New(fmt.Sprintf("ERROR: %s", err.Error())) | |
| 187 | 187 | txt.Style = vaxis.Style{Foreground: red} | |
| 188 | 188 | txtSurf, _ := txt.Draw(ctx) | |
| 189 | 189 | root.AddChild(0, ah, txtSurf) |