diff --git a/handler.go b/handler.go index 46b3cef..8b687e7 100644 --- a/handler.go +++ b/handler.go @@ -2,14 +2,13 @@ package brave import ( "encoding/json" - "fmt" "net/http" ) func handleRequest[T any](client *http.Client, req *http.Request) (*T, error) { res, err := client.Do(req) if err != nil { - return nil, fmt.Errorf("error in request %s: %w", req.URL.String(), err) + return nil, err } defer res.Body.Close() diff --git a/types.go b/types.go index 3225d84..a0ebb8e 100644 --- a/types.go +++ b/types.go @@ -584,8 +584,8 @@ func (er ErrorResponse) Format(f fmt.State, c rune) { e.Type, strings.Join(e.Loc, "."), e.Input, e.Message)) } - fmt.Fprintf(f, "error: %s (ID: %s; Status: %d; Code: %s); details: %s", - er.Detail, er.ID, er.Status, er.Code, strings.Join(meta, ", ")) + fmt.Fprintf(f, "error: %s (ID: %s; Status: %d; Code: %s RawQuery: %s); details: %s", + er.Detail, er.ID, er.Status, er.Code, strings.Join(meta, ", "), er.RawQuery) } else { fmt.Fprint(f, er.Detail) }