You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, it's useful to detect and handle specific errors on the client side (e.g., TOO_MANY_SIMULTANEOUS_QUERIES).
However, now Error::BadResponse contains only String, forcing users to use details.contains(code).
Describe the solution you'd like
Replace Error::BadResponse(String) with Error::BadResponse(BadResponseDetails) where BadResponseDetails contains code (numeric code), reason (string like TOO_MANY_SIMULTANEOUS_QUERIES) and message (the current String argument).
BadResponse is also used for HTTP errors, so we need to decide what should be stored in code and reason in this case. Another way is to divide BadResponse into two separate variants.
The text was updated successfully, but these errors were encountered:
Use case
Sometimes, it's useful to detect and handle specific errors on the client side (e.g.,
TOO_MANY_SIMULTANEOUS_QUERIES
).However, now
Error::BadResponse
contains onlyString
, forcing users to usedetails.contains(code)
.Describe the solution you'd like
Replace
Error::BadResponse(String)
withError::BadResponse(BadResponseDetails)
whereBadResponseDetails
containscode
(numeric code),reason
(string likeTOO_MANY_SIMULTANEOUS_QUERIES
) andmessage
(the currentString
argument).BadResponse
is also used for HTTP errors, so we need to decide what should be stored incode
andreason
in this case. Another way is to divideBadResponse
into two separate variants.The text was updated successfully, but these errors were encountered: