default branch returns error fmt.Errorf("unexpected status code %d", resp.StatusCode) instead of generic errors.New("unexpected error")
Reasoning:
I had unexpected error errors and couldn't figure out why my key/secret pair wasn't working. Turns out I forgot to set address to point to Bybit testnet. Bybit returned status code 401 (my testnet key/secret were invalid for Bybit production environment). unexpected error without extra context isn't very helpful in similar cases.
Changes:
fmt.Errorf("unexpected status code %d", resp.StatusCode)
instead of genericerrors.New("unexpected error")
Reasoning:
unexpected error
errors and couldn't figure out why my key/secret pair wasn't working. Turns out I forgot to set address to point to Bybit testnet. Bybit returned status code 401 (my testnet key/secret were invalid for Bybit production environment).unexpected error
without extra context isn't very helpful in similar cases.