- **fix(errors):** ensure proper error handling with errors.Is instead of direct comparison for http.ErrServerClosed
- **fix(sql):** wrap `rows.Close` in a `defer` function to safely handle potential close errors - **fix(api):** handle JSON encoding errors in API responses to prevent unhandled edge cases - **docs:** correct typos and improve phrasing in `.claude/CLAUDE.md` - **test:** add error handling for `UpdateEvent` in test cases
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -44,7 +45,7 @@ func main() {
|
||||
|
||||
go func() {
|
||||
log.Printf("Listening on :%s", port)
|
||||
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||
if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
|
||||
log.Fatalf("ListenAndServe: %v", err)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user