-
Notifications
You must be signed in to change notification settings - Fork 60
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
Moshi parsing exceptions are swallowed #6
Comments
Is it possible that you're running a CoroutineExceptionHandler in the CoroutineScope of your API call? I shall take a look at this over the weekend and see if I can reproduce this. |
We don't have any CoroutineExceptionHandler, I also searched in the whole project just in case but nothing. |
I'm not sure where exactly is the error swallowed, but this issue does highlight the need for a new subclass for I've created a new Since this is a breaking change, I have not merged it to the master branch yet. Please try it and let me know if this change helps you. |
Awesome, thanks! I'll give it a try and let you know. |
Integration into our project worked fine and now it shows a correct error in the UI instead of swallowing the exception 👍 Thanks again for the fix and fast response. |
I'm glad the fix works for you. I'm gonna keep it in alpha, and promote it to a stable release after some time. Closing this issue for now. |
Moshi parsing exceptions are swallowed when data parsing fails.
The culprit is this line that rethrows exceptions instead of parsing them into unknown/generic errors:
https://github.com/haroldadmin/NetworkResponseAdapter/blob/master/src/main/kotlin/com/haroldadmin/cnradapter/ErrorExtraction.kt#L32
Strange enough, the exception is logged to logcat but wrapping the suspend function with a try/catch does not work, the exception is swallowed somewhere between this library and retrofit.
The text was updated successfully, but these errors were encountered: