1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

refactor: Improve logging of error messages

Logging bare errors might lead to long troubleshooting sessions when error
is not specific enough. This commit adds helpful context messages to
logged errors.

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
This commit is contained in:
Vitaliy Potyarkin 2024-12-28 12:52:17 +03:00
parent 84eca8312d
commit 591770bf63
2 changed files with 11 additions and 7 deletions

View file

@ -300,7 +300,7 @@ func Serve(ctx context.Context, artifactPath string, addr string, port string) c
go func() {
logger.Infof("Start server on http://%s:%s", addr, port)
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
logger.Fatal(err)
logger.Fatalf("http listener: %v", err)
}
}()