How do I bypass a fatal error handling in CakePHP custom Authenticator Object?
-
25-06-2021 - |
Question
I'm doing a soap based authentication in my custom Authenticator object. Sometime the soap endpoint may not be available. This in sequence will throw a
SOAP-ERROR: Parsing WSDL: Couldn't load from
and then will be handled by
ErrorHandler::handleFatalError(1, 'SOAP-ERROR: Par...', '/home/bombadil/...', 100)
in lib/Cake/Error/ErrorHandler.php and then the page will be redirected to lib Cake/View/Errors/fatal_error.ctp
Now, how do I redirect to my login page again and showing a toned down error message instead of throwing the unfriendly page of fatal_error.ctp? I can't afford to create another fatal_error page because I want to redirect again to my login page.
Thanks
Solution
NVM, I raise an exception upon unsuccessful connection in the Soap datasource and catch it at my model which doing the Soap based authentication.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow