Skip to content

Commit

Permalink
Merge pull request #1307 from hamidrezakp/main
Browse files Browse the repository at this point in the history
  • Loading branch information
clairernovotny authored Feb 7, 2022
2 parents 92ee888 + a191b10 commit 0331f2f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1157,16 +1157,17 @@ Refit traps any `ApiException` raised by the `ExceptionFactory` when processing

You can then decide what to do like so:

var response = await _myRefitClient.GetSomeStuff();
if(response.IsSuccessStatusCode)
{
//do your thing
}
else
{
_logger.LogError(response.Error, response.Error.Content);
}

```csharp
var response = await _myRefitClient.GetSomeStuff();
if(response.IsSuccessStatusCode)
{
//do your thing
}
else
{
_logger.LogError(response.Error, response.Error.Content);
}
```

#### When returning `Task<T>`
Refit throws any `ApiException` raised by the `ExceptionFactory` when processing the response and any errors that occur when attempting to deserialize the response to `Task<T>`.
Expand Down

0 comments on commit 0331f2f

Please sign in to comment.