Skip to content

Commit

Permalink
libxc/binance: Better error message
Browse files Browse the repository at this point in the history
Return the actual error message in the error so it prints properly on
the UI.
  • Loading branch information
martonp committed Dec 3, 2024
1 parent 0030e49 commit 460d1be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/mm/libxc/binance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1330,8 +1330,12 @@ func (bnc *binance) request(ctx context.Context, method, endpoint string, query,
}
if err := dexnet.Do(req, thing, dexnet.WithSizeLimit(1<<24), dexnet.WithErrorParsing(&errPayload)); err != nil {
bnc.log.Errorf("request error from endpoint %s %q with query = %q, body = %q", method, endpoint, queryString, bodyString)
return fmt.Errorf("%w, bn code = %d, msg = %q", err, errPayload.Code, errPayload.Msg)
if errPayload.Msg != "" {
return fmt.Errorf("Binance error: %v", errPayload.Msg)
}
return err
}

return nil
}

Expand Down

0 comments on commit 460d1be

Please sign in to comment.