Ecodev / felix

Various utilities tailored for our ecosystem
MIT License
1 stars 0 forks source link

ErrorHandler for CLI usage #4

Open PowerKiKi opened 3 years ago

PowerKiKi commented 3 years ago

For HTTP usage we leverage \Laminas\Stratigility\Middleware\ErrorHandler (via pipeline.php) to automatically log all kind of exception/error/warning.

We have no equivalent for CLI usage. So a CLI usage might throw an exception that might never be logged through our standard channels (db, file, emails).

We should come up with a solution to that. Either upgrade our CLI command architecture to something more integrated (laminas-cli ? Symfony Console ? something else ?) or something more custom like:

FelixCustomErrorHandler::runSafely(function() { /* command code */ });