Skip to content

Error Resistible Event interface#34

Closed
Fedik wants to merge 7 commits intojoomla-framework:3.x-devfrom
Fedik:event-no-fail
Closed

Error Resistible Event interface#34
Fedik wants to merge 7 commits intojoomla-framework:3.x-devfrom
Fedik:event-no-fail

Conversation

@Fedik
Copy link

@Fedik Fedik commented Jul 21, 2023

Summary of Changes

A new interface, ErrorResistibleEventinterface, for error resistible events.
The event that implement this interface do not crash the dispatching process when an exception happening.
The dispatcher collect errors during this event, and gives it to the event for further handling.

This can help to solve issue for crashed system plugins in CMS. (In combination with joomla/joomla-cms#40522 and some update for exceptions handler.)

Testing Instructions

Test passes

Documentation Changes Required

A new feature.

@Fedik
Copy link
Author

Fedik commented Jul 29, 2023

I have changed original implementation to be sure all errors is handled, and nothing gets "muted" by accident.

@Fedik
Copy link
Author

Fedik commented Jul 29, 2023

Another way of doing it, would be on Dispatcher level (instead of fancy interface for events).
Have some kind of:

public Dispatcher::setErrorHandler(callable $handler)
private Dispatcher::handleEventError($event, $exception)

Thoughts?

@Fedik
Copy link
Author

Fedik commented Jul 30, 2023

This will be better #35

@Fedik Fedik closed this Jul 30, 2023
@Fedik Fedik deleted the event-no-fail branch July 30, 2023 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant