-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Presenter::$onAfterSignal event #309
base: v3.1
Are you sure you want to change the base?
Conversation
$signalException = null; | ||
try { | ||
$this->processSignal(); | ||
} catch (Throwable $signalException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the catch can be omitted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used to assign Throwable to $signalException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove it too. Just try ... finally
Seem legit. For consistency, it might be a good idea to add $onSignal too. |
d6fabf9
to
5d1c0e3
Compare
a6e64a8
to
7b53e9d
Compare
79af108
to
9c31b24
Compare
3816adb
to
b08ddd5
Compare
94b5e36
to
32db4c2
Compare
ae29a56
to
e5e0e3b
Compare
bfe61e7
to
e697d90
Compare
3e12237
to
b170b62
Compare
855889b
to
f503641
Compare
I am currently working on a Tracy panel which tracks submitted forms and shows errors from these forms.
This is useful for debugging manually rendered forms which don't render all form errors. e.g. datagrids
Problem is it is currently hooked via
onStartup
event. That works only for components that are created viacreateComponent*()
, have all required parameters for creation available during startup and are not created manually - e.g. via$this['form'] = new Form();
inaction*()
method. It also changes order of code execution.Having an
onAfterSignal
event would solve all of these issues and would also allow me to handle successfully submitted forms (which throw AbortException for redirect) and other signalsCurrent (bad) solution:
If you agree on proposed solution @dg I will write some tests for it.