Skip to content

Conversation

@soyuka
Copy link
Member

@soyuka soyuka commented Dec 18, 2025

Q A
Branch? 4.1
Tickets Closes #7466
License MIT

The fix properly handles both issue #7058 (custom exception handler classes) and issue
#7466 (callbacks registered after booting) by:

  • First checking if any renderable() callbacks registered on the ErrorHandler instance
    can handle the exception
  • If not handled, delegating to the decorated handler (for custom exception handler
    classes)
  • Falling back to parent::render() if no decorated handler exists

Also removed the unnecessary call to $this->decorated->render() after successfully
handling API Platform exceptions, which was causing custom handlers to be invoked for API
operations.

@soyuka soyuka force-pushed the fix/error-handler-laravel branch 2 times, most recently from ffb6515 to 340790b Compare December 18, 2025 14:01
@soyuka soyuka force-pushed the fix/error-handler-laravel branch from 340790b to be222d1 Compare December 18, 2025 14:05
@soyuka soyuka merged commit 0d9a44b into api-platform:4.2 Dec 18, 2025
126 of 130 checks passed
@soyuka soyuka deleted the fix/error-handler-laravel branch December 18, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant