In this pull request, I changed the error handling for the API client to match-statements instead of if-statements. The logic for the change is that the match-statement allow the API client to handle the successful results expected from the API properly and then treat all other results as an API error, this also reduces the risk of not capturing some edge cases with the if-statement.
In this pull request, I changed the error handling for the API client to
match-statements
instead ofif-statements
. The logic for the change is that thematch-statement
allow the API client to handle the successful results expected from the API properly and then treat all other results as an API error, this also reduces the risk of not capturing some edge cases with theif-statement
.