~/talk

Journey through "unhappy path" - Dealing with exceptional conditions

Talkat Dutch PHP Conference 2018 · 2018-06-07..06-09· [software-architecture]
speakerdeck:nikolaposa
slides:none on file

Avoid returning nulls and optional dependencies; prefer a special case object for absent domain entities and throw exceptions where business rules are violated. Create custom exception types organized under an Exception namespace, use a marker interface for component-level catches, and embed context via named constructors so messages are structured and data-accessible. Wrap third-party errors (example: Guzzle) into domain exceptions preserving the previous exception, centralize handling with Whoops and PSR-3 logging, and test exceptions consistently with arrange–act–assert.

AI-written summary · about

  1. 0:00Introduction
  2. 1:03Unhappy path
  3. 5:07Special case
  4. 9:43Create custom exception types
  5. 11:14Single responsibility principle
  6. 11:50Exception type
  7. 13:27Formatting exception messages
  8. 14:43Providing a context
  9. 15:35Exception wrapping
  10. 17:50Why so many exceptions
  11. 18:54Challenges
  12. 21:25Central Error Handler
  13. 22:21Whoops
  14. 27:57Test exception behavior
  15. 28:35Arrange act assert
  16. 29:54Feedback
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.