Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify error parsing #10

Closed
garrytrue opened this issue Apr 30, 2020 · 2 comments
Closed

Simplify error parsing #10

garrytrue opened this issue Apr 30, 2020 · 2 comments

Comments

@garrytrue
Copy link
Contributor

I think HttpException.extractFromHttpException can return NetworkResponse.ServerError instead if NetworkResponse.

And one more, you have broken test in ErrorExtractionTest

If you allow me I can make a PR with fixes

@haroldadmin
Copy link
Owner

haroldadmin commented Apr 30, 2020

Thank you for pointing out the issue. I looked into the testing setup as a result and as it turns out, most of the tests are not being picked up by Gradle.

The project right now has 42 tests, but running ./gradlew clean test only executes 18 of them. This is why I missed the broken test in ErrorExtractionTest. I have found there are a few other broken tests too which need fixing.

The reason is that some test classes do not extend from a base class of kotlintest library. I am working on a fix for this.

Regarding the HttpException.extractFromHttpException point, I think you're right. An HTTP exception by definition indicates that an error response was received from the server, so classifying it as something other than a ServerError would be silly.

Feel free to make a PR for this, I am happy to accept external contributions.

@haroldadmin
Copy link
Owner

Closed with #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants