-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature in controller class about exceptions #2
Comments
Closed
This was referenced May 26, 2014
Closed
Closed
Closed
请使用最新版 3.0.8+php7.3 即可 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was thinking for a feature in controller class, about exceptions.
Yaf can catch exceptions, by setting catchException to true in application.ini, and forwards to the Error controller.
It would be nice to give the developer the chance to rescue this exception through a controller method, without turning off the usefull in most cases catchException option.
For example, an apllication may not throws only error exceptions. There are 404 not found exceptions or 401 Unauthorized exceptions or 403 Forbidden exceptions.
A method in controller rescueFromException(Exception $e) would be usefull.
By default would forward to ErrorController, if catchException is on, but developer could overload it and make some checks and forward other controllers, according to exceptions.
The text was updated successfully, but these errors were encountered: