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
Copy file name to clipboardexpand all lines: README.md
+7-3
Original file line number
Diff line number
Diff line change
@@ -518,7 +518,7 @@ and you're able to handle cancellation
518
518
#### What does custom error means?
519
519
520
520
You may define your own custom errors, globally or for each request.
521
-
`onError` block contains `NetworkError` object with `StatusCode` enum and an error description, so that description you could change to whatever you want for any error code.
521
+
`onError` block contains `NetworkError` object with `StatusCode` enum, an error description, and a raw response `Data`. Error description you could change to whatever you want for any error code.
522
522
By default there are already defined some good descriptions for common errors.
523
523
524
524
Let's take a look how we can use powerful `onError` block
@@ -529,7 +529,11 @@ Let's take a look how we can use powerful `onError` block
529
529
case .internalServerError:print("Oooops... Something really went wrong...")
530
530
case .custom(let code):print("My non-standard-custom error happened: "+ error.description)
531
531
case .unknown(let code):print("Totally unknown error happened: "+ error.description)
0 commit comments