@@ -133,12 +133,16 @@ It will return [Success[Response] or Failure[Exception]](https://returns.readthe
133
133
And will never throw this exception at us.
134
134
135
135
When we will need raw value, we can use ` .unwrap() ` method to get it.
136
- If the result is ` Failure[Exception] ` we will actually raise an exception at this point.
137
- But it is safe to use ` .unwrap() ` inside [ @pipeline ] ( https://returns.readthedocs.io/en/latest/pages/functions.html#returns.functions.pipeline )
136
+ If the result is ` Failure[Exception] `
137
+ we will actually raise an exception at this point.
138
+ But it is safe to use ` .unwrap() ` inside
139
+ [ @pipeline ] ( https://returns.readthedocs.io/en/latest/pages/functions.html#returns.functions.pipeline )
138
140
functions.
139
- Because it will catch this exception and wrap it inside a new ` Failure[Exception] ` !
141
+ Because it will catch this exception
142
+ and wrap it inside a new ` Failure[Exception] ` !
140
143
141
- And we can clearly see all result patterns that might happen in this particular case:
144
+ And we can clearly see all result patterns
145
+ that might happen in this particular case:
142
146
- ` Success[UserProfile] `
143
147
- ` Failure[HttpException] `
144
148
- ` Failure[JsonDecodeException] `
@@ -152,7 +156,7 @@ with all the possible errors.
152
156
153
157
But is that all we can improve?
154
158
Let's look at ` FetchUserProfile ` from another angle.
155
- All its methods looks like a regular ones:
159
+ All its methods looks like regular ones:
156
160
it is impossible to tell whether they are pure or impure from the first sight.
157
161
158
162
It leads to a very important consequence:
0 commit comments