Replies: 1 comment 2 replies
-
At that point you could also basically copy Throwing for bad status code is one of the main differences to the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was thinking a lot about this while playing with the wrong
stackTrace
s issue.The whole concept of throwing a
DioError
in case of a server response with a bad status code seems wrong.With the advent of sealed classes and pattern matching, it would be a nice time to design a new API for Dio.
Something along the lines:
I think we can completely get rid of
DioError
with this. Response errors are justFailure
s and don't need a stackTrace because they are not thrown around anymore. And all other errors don't need to be wrapped, instead we could provide some smart helpers for error handling.What do you guys think? @AlexV525 @ueman
Beta Was this translation helpful? Give feedback.
All reactions