I want to handle Exceptions in my Listener exactly in handle() method
/**
* Handle the event.
*
* @param DocumentGenerated $event
* @return void
*/
public function handle(DocumentGenerated $event)
{
$data = $event->data;
$this->generateDoc($data);
}
After I read the documentation I found that the handle() method of the listener should return false to stop the event propagation.
I changed the return type of the handle() method from void to boolean and tried returning false but it didn’t stop the event propagation.