Catch specific exceptions when recovery is possible and use Throwable at an application boundary: ~~~php try { $user = $service->load($id); } catch (NotFoundException $e) { return Response::notFound(); } catch (Throwable $e) { $logger->error('User load failed', ['exception' => $e]); throw $e; } ~~~ Prefer throwing domain exceptions over returning false or null for errors, never leave a catch block empty, and use finally for cleanup.
Installs into .claude/skills of the current project.
Are you the author of Php Error Handling?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-php-error-handling-agent-skills-standard)
Catch specific exceptions when recovery is possible and use Throwable at an application boundary:
~~~php
try {
$user = $service->load($id);
} catch (NotFoundException $e) {
return Response::notFound();
} catch (Throwable $e) {
$logger->error('User load failed', ['exception' => $e]);
throw $e;
}
~~~
Prefer throwing domain exceptions over returning false or null for errors, never leave a catch block empty, and use finally for cleanup.