Skip to content

[NFR]: ADR exceptions source #47

Closed
Closed

Description

@niden

Summary

ADR does not fire dispatch:beforeException, so the Exceptions panel stays empty. Feed ExceptionsCollector from the logger.

Current state

  • Phalcon\ADR\Application::handle() catches each exception and fires no event with it.
  • Phalcon\ADR\ErrorResponder is final and has no contract, so it is not practical to decorate.
  • ErrorResponder::handle() logs each exception with ["exception" => $exception, "ref" => $ref] as the context. A probe confirmed that a logger adapter receives it.
  • DebugBar::addException() already exists (src/DebugBar/DebugBar.php:63).

Proposed direction

  • Add a small logger adapter that reads context['exception'] and calls DebugBar::addException(). The existing Phalcon\DebugBar\Logger\Adapter uses the same route with DebugBar::addLog().
  • Keep it separate from Phalcon\DebugBar\Logger\Adapter. An MVC app that logs an exception in the context would otherwise record the exception twice.
  • The application adds the adapter to its logger, as it does for the existing adapter. Phalcon\Contracts\Logger\Logger has no addAdapter() method, so the bar cannot do this for every logger. Document this.

Known limit

If the error responder itself fails, Application::handle() returns a bare 500 and nothing logs the exception. The panel does not show it.

Acceptance

  • In an ADR app, an exception that reaches ErrorResponder shows in the Exceptions panel.
  • The exception is not swallowed and the response does not change.
  • The MVC exceptions source is unchanged.
  • Tests pass with full coverage. phpcs and phpstan pass.

Depends on

Part of

#13

Activity

  1. self-assigned this
    on Nov 3, 2026
  2. added theissue type on Nov 3, 2026
  3. moved this from Backlog to Active Sprint in Phalcon v5on Nov 3, 2026
  4. niden commented on Nov 4, 2026

    @niden
    SponsorMemberAuthor

    Resolved in #56

  5. moved this from Active Sprint to Implemented in Phalcon v5on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

  • Status
    Implemented

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions