Skip to content
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

set_exception_handler() inside event closure is ignored #380

Open
drjayvee opened this issue Oct 22, 2021 · 0 comments
Open

set_exception_handler() inside event closure is ignored #380

drjayvee opened this issue Oct 22, 2021 · 0 comments

Comments

@drjayvee
Copy link
Contributor

drjayvee commented Oct 22, 2021

Crunz version: 3.0.1

PHP version: 7.4.24

Operating system type and version: Ubuntu

Description
set_exception_handler() inside event closures isn't called.

We set up a global error handler (Sentry) and missed uncaught exceptions, as we weren't looking at the logs.

set_error_handler works just fine.

How to reproduce

<?php

$sch = new Crunz\Schedule();

$sch->run(function () {
	set_exception_handler(static function (Throwable $e) {
		// report $e
	});
	
	throw new Exception('Uh-Oh SpaghettiOs');
})
	->name("Where are teh errors?")
	->everyMinute()
;

return $sch;

Additional context
This is not due to the Opis Closure serialization.

Does crunz closure:run set up its own exception handler?

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

No branches or pull requests

1 participant