Closed (fixed)
Project:
Drupal for Facebook
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
2 Sep 2011 at 12:50 UTC
Updated:
17 Apr 2012 at 17:51 UTC
Why does the fb_app_init() function set an exception handler?
I've never actually seen it handle an exception from the FB module, rather it tends to handle uncaught exceptions coming from other modules. This leads to confusion, as most people assume its an issue with the FB module, when it very rarely is.
Now, I agree that the exception handler is a little better than the one that comes with Drupal, however, in a production site it is much, much worse. I would argue that changing the exception handler would be a better task for devel module?
Comments
Comment #1
Dave Cohen commentedIf memory serves, in D6 there is no other exception handler. So some of how this works may be historical.
As it describes in the comments, ideally the exception handler would be configurable or would honor a previously defined handler. I don't think php provides a way to check whether one is already defined, but apparently you can restore the previous handler after setting one. So maybe there's some way to not trample on Drupal's default.
I don't believe it should be defined in devel, because exceptions need to be handled even on live sites where devel is disabled.
Comment #2
ianthomas_ukChanging the default exception handler is no where near the functionality that I would expect a facebook module to provide. Ideally exception handling (with varying behaviour between dev and live) should be part of Core, but if you want to improve on that it should be in a separate module.
Comment #3
Dave Cohen commentedAgreed. It's only there for historical reasons. I'll remove it.
Comment #4
Dave Cohen commentedPushed this.