• Talk
  • 2026

Mastering Failures: Building Resilient PHP/Symfony Apps with Domain-Driven Exceptions

Speaker:

Topics:

  • Framework

Abstract

Are your exceptions a silent killer of user experience, or worse, a source of critical data leaks? In modern, complex applications, the default exception handling often falls short, leading to inconsistent HTTP status codes, poor logging, and fragile business logic.

This session dives beyond simple try-catch blocks to provide a comprehensive guide on truly mastering exception flow. We will explore the entire lifecycle of an error, from the PHP Throwable interface up through the Symfony Kernel.

Key Takeaways include:

  • Domain-Driven Throwing: Learn the crucial difference between infrastructure errors (e.g., \PDOException) and business failures (e.g., InsufficientFundsException), and how to wrap and throw exceptions that make sense to the domain layer.
  • Symfony Architecture Deep Dive: Understand how the KernelEvents::EXCEPTION event and the ExceptionListener work together to reliably convert any unhandled Throwable into an appropriate HTTP response.
  • Robust Handling & Observability: Practical strategies for mapping custom exceptions to correct HTTP status codes (using attributes or config), implementing layered Monolog logging with contextual processors, and decoupling critical failure logic using Symfony Messenger.

You will leave equipped with advanced patterns to ensure your applications are more secure, maintainable, and observable, turning confusing runtime failures into predictable, traceable system events.

Related Talks 2026