joshuag Posted December 28, 2012 Posted December 28, 2012 Does anyone know a way that I can create a module hook that can hook into PW exceptions? I don't see any methods in the Exception Classes that are hookable ___ . Thanks in advance,
joshuag Posted December 28, 2012 Author Posted December 28, 2012 ok, I want to catch a DB exception inside a module... but I am thinking that modules don't get loaded if there is a DB connection error... so I think I am hooped.
Soma Posted December 29, 2012 Posted December 29, 2012 If there is no hookable function you cant. And as you found out if db connect error is thrown theres nothing you can do obviously. But if you let us know what you like to do we maybe can help.
Nico Knoll Posted December 29, 2012 Posted December 29, 2012 -- Moved into development -- Please create a separate topic in "modules" for the finished module.
ryan Posted December 29, 2012 Posted December 29, 2012 Exceptions are catchable, not hookable. I could probably add a hook to manually trigger in PW's main exception handler. Though if a DB exception occurs at bootstrap time (which is when you'd likely see it, if it occurred), then any modules wouldn't yet be loaded. This would also introduce the potential of infinite loops, like if any of the hooked functions themselves triggered an exception. It would be more likely to occur in this case (the last resort exception handler) since an exception at this point is a fatal error and means something about the system isn't working. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now