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 {
467467 w.Header().Add("content-type", "text/plain")
468468
469469 if err != nil {
470- logger.Error("error reading request body", "err", err.Error())
470+ logger.Error("ERROR: reading request body", "err", err.Error())
471471 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())
473473 return
474474 }
475475
+2, -2
......@@ -437,8 +437,8 @@ func (web *WebRouter) ImageRequest(perm func(proj *db.Project) bool) http.Handle
437437
438438 opts, err := storage.UriToImgProcessOpts(imgOpts)
439439 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)
442442 http.Error(w, errMsg, http.StatusUnprocessableEntity)
443443 return
444444 }
+1, -1
......@@ -192,7 +192,7 @@ func Middleware(handler *CliHandler) pssh.SSHServerMiddleware {
192192 user, err := getUser(sesh, dbpool)
193193 if err != nil {
194194 _, _ = 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)
196196 sesh.Fatal(s)
197197 return s
198198 }
+2, -2
......@@ -188,7 +188,7 @@ func Middleware(writeHandler utils.CopyFromClientHandler) pssh.SSHServerMiddlewa
188188 defer func() {
189189 if r := recover(); r != nil {
190190 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"))
192192 }
193193 }()
194194
......@@ -201,7 +201,7 @@ func Middleware(writeHandler utils.CopyFromClientHandler) pssh.SSHServerMiddlewa
201201
202202 optsCtx, err := rsyncopts.ParseArguments(cmdFlags[1:], true)
203203 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())
205205 return err
206206 }
207207
+1, -1
......@@ -183,7 +183,7 @@ func (m *AccessLogsPage) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) {
183183 ah += int(brdSurf.Size.Height)
184184
185185 if err != nil {
186- txt := text.New(fmt.Sprintf("Error: %s", err.Error()))
186+ txt := text.New(fmt.Sprintf("ERROR: %s", err.Error()))
187187 txt.Style = vaxis.Style{Foreground: red}
188188 txtSurf, _ := txt.Draw(ctx)
189189 root.AddChild(0, ah, txtSurf)