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

Fatal Exception: com.prof18.rssparser.exception.HttpException #119

Closed
saldous opened this issue Sep 10, 2023 · 5 comments
Closed

Fatal Exception: com.prof18.rssparser.exception.HttpException #119

saldous opened this issue Sep 10, 2023 · 5 comments
Labels

Comments

@saldous
Copy link

saldous commented Sep 10, 2023

Updated my app from v5.0.3 to 6.0.1 and suddenly getting this from some user logs:

Fatal Exception: com.prof18.rssparser.exception.HttpException:
       at com.prof18.rssparser.internal.JvmXmlFetcher$await$2$2.onResponse(JvmXmlFetcher.kt:48)
       at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:923)

I've not been able to reproduce it yet, but over 100 crash events reported in Crashlytics

@saldous saldous added the bug label Sep 10, 2023
@prof18
Copy link
Owner

prof18 commented Sep 11, 2023

Hi,
that's an expected behaviour. This exception happens if the URL returns an HTTP error not in the range from 200 to 299. The logic didn't change with the new release

@saldous
Copy link
Author

saldous commented Sep 11, 2023

@prof18 how can I catch it so it doesn't crash the app? I'm already doing:

try {
    val channel = parser.getRssChannel(feed.url)
} catch (e: Exception) {
    println(e.message)
}

yet the app is crashing

@prof18
Copy link
Owner

prof18 commented Sep 11, 2023

You can catch it with HttpException or Throwable!

But, I realized that HttpException extends Throwable and not Exception, that's because your try/catch didn't catch the exception. I will release a bugfix ASAP.

Thanks for reporting!

@prof18 prof18 closed this as completed in e54484d Sep 11, 2023
@TwinklingToon
Copy link

i want to fetch details in rss having following tag
<media:content url="https://images.news18.com/ibnlive/uploads/2023/08/untitled-design-2023-08-24t122426.836-16928601053x2.jpg" medium="image" height="800" width="1200"/>
how this can be done?

@prof18
Copy link
Owner

prof18 commented Sep 22, 2023

@TwinklingToon can you please open a new issue and provide a link to the RSS feed?

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

No branches or pull requests

3 participants