Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@irfan-dahir
Copy link
Contributor

@irfan-dahir irfan-dahir commented Jul 7, 2022

This PR improves exception handling and reporting. Right now it's exhausting all sentry transactions (5k in the free tier) within the first week or so. This is because TimeoutException and other unnecessary exceptions are being sent to it as well.


  • Reduces sentry default sample rate to 50% of errors to prevent flooding
  • Sets up sentry-only allowed exceptions (ParserException only added as of this moment) to track parser errors
  • Re-arrange the order of exception chain

Exception to check in order

  1. Redis Connection Exception
  2. ParserException
  3. BadResponseException (from Parser)
  4. TimeoutException (from Parser)
  5. if ($e instanceof Exception && $e->getMessage() === "Undefined index: url") {
    a. MAL returns blank pages for some reason sometimes. And this is the generated error
  6. HTTPException (Bad REST API requests)
  7. Uncaught exception

That sentry thing is awesome, would it be possible to include that link in the generated issues?
jikan-me/jikan#449 (comment)

I don't think that's possible. But I am working on integrating Sentry with GitHub and this repo so sentry should automatically create issues for us if it hits a parser exception.

@irfan-dahir irfan-dahir merged commit bd8a9f8 into master Jul 10, 2022
@irfan-dahir irfan-dahir deleted the enhancement/exception-handler branch July 10, 2022 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants