sentry-php: Fatal errors are not recorded with the curl method async

Sentry flushes the unsent messages and calls curl join in the onShutdown method, which is correctly registered to run on shutdown.

However, fatal errors are logged on the ErrorHandler shutdown callback, which is registered after onShutdown. (onShutdown is registered on the Client constructor, and error_handler->registerShutdownFunction is call after you build the Client).

The end result is that a Fatal error gets recorded internally, but it’s not send as onShutdown has already been called.

You need to make sure onShutdown runs after all other shutdown handlers.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (10 by maintainers)

Commits related to this issue

Most upvoted comments

You’re right once again @mfb, thanks a lot for your help! You can check out the result in #576, I used your code to finally fix it! Does that work for you?