Closed esetnik closed 4 years ago
I don't think you can "handle" it. A fatal error is just that, fatal.
You can handle some of those exceptions via register_shutdown_function()
.
See https://github.com/slimphp/Slim-Skeleton/blob/f544b305f06a6a2743a033aad9fd20a3f4e3b250/public/index.php#L60 for an example
You could use catch(Exception | Throwable $ex)
I'm closing this as resolved as no further input has been provided.
Let's say we have some code inside a controller that triggers
PHP Fatal error: Uncaught TypeError: Argument 1 passed to...
. How do we implement error handling for this scenario. Specifically, if this occurs I'd it to trigger my customerrorHandlerMiddleware
.I didn't find anything about this in the v4 documentation. I'm happy to submit a PR with updated docs once I understand what the correct approach is.