Page MenuHomeIn-Portal Phabricator

INP-1522 - Exception/Fatal Error in CLI are displayed using HTML markup
ClosedPublic

Authored by alex on Apr 13 2026, 4:25 AM.

Details

Test Plan

Part 1 - exception CLI

IMPORTANT: Apply the D568 is applied before testing.
  • in the IDE:
    1. open the core/units/admin/admin_events_handler.php file for editing
    2. replace the \AdminEventsHandler::OnDeploy method body with the throw new LogicException('Testing.'); code
    3. save changes
  • in CLI:
    1. execute the ./in-portal event:run adm:OnDeploy -v command
    2. confirm that:
      • an exception class/message/backtrace is displayed
      • an exception message and backtrace are separated by a *single* empty line
      • there is a *single* empty line before/after displayed data (exception class+message+backtrace block in a whole)
      • the 1st frame in a backtrace points to the line with a throw ... statement in it
  • login to the Admin Console
    1. go to the Logs & ReportsSystem Log section
    2. confirm that the above-thrown exception was properly logged (the 1st backtrace frame doesn't point to the line with the throw ... statement in it)

Part 2 - fatal error CLI

  • in the IDE:
    1. open the core/units/admin/admin_events_handler.php file for editing
    2. replace the \AdminEventsHandler::OnDeploy method body with the trigger_error('Testing', E_USER_ERROR); code
    3. save changes
  • in CLI:
    1. execute the ./in-portal event:run adm:OnDeploy -v command
    2. confirm that:
      • a fatal error message/backtrace is displayed
      • a fatal error message and backtrace are separated by a *single* empty line
      • there is a *single* empty line before/after displayed data (fatal error message+backtrace block in a whole)
      • the 1st frame in a backtrace points to the line with a trigger_error( ... statement in it
  • login to the Admin Console
    1. go to the Logs & ReportsSystem Log section
    2. confirm that the above-triggered fatal error was properly logged (the 1st backtrace frame points to the line with the trigger_error( ... statement in it)

Part 3 - SQL error Web

IMPORTANT: Apply the D567 is applied before testing.
  • in the IDE:
    1. open the core/units/admin/admin_events_handler.php file for editing
    2. replace the \AdminEventsHandler::OnDeploy method body with the $this->Conn->Query('SELECT * FROM NonExistingTable'); code
    3. save changes
    4. enable the Debug Mode
  • in Web:
    1. login to the Admin Console
    2. go to the ToolsSystem Tools section
    3. press the Deploy button
    4. confirm that an exception (due to an SQL error) is displayed in Debugger
    5. go to the Logs & ReportsSystem Log section
    6. confirm that the above-thrown exception was properly logged (the 1st backtrace frame doesn't point to the line with the throw ... statement in it)

Diff Detail

Repository
rINP In-Portal
Branch
branches/5.3.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 11222
Build 3922: arc lint + arc unit

Event Timeline

alex created this revision.Apr 13 2026, 4:25 AM
alex requested review of this revision.Apr 13 2026, 4:25 AM
alex updated this revision to Diff 1470.Apr 13 2026, 5:06 AM
alex edited the test plan for this revision. (Show Details)

Bugfix: double backtrace frame for logged fatal errors was displayed in CLI.

erik requested changes to this revision.Apr 13 2026, 5:45 AM

Tested with part 1 and part 2 of the test plan.

Cant test part 3, because required patch D567 is for in-portal 5,2, but current task is for in-portal 5.3 version. Maybe, there is error in the test plan.

This revision now requires changes to proceed.Apr 13 2026, 5:45 AM
erik accepted this revision.Apr 13 2026, 6:39 AM
This revision is now accepted and ready to land.Apr 13 2026, 6:39 AM
alex added a comment.Apr 13 2026, 6:54 AM
In D569#11652, @erik wrote:

Tested with part 1 and part 2 of the test plan.

Cant test part 3, because required patch D567 is for in-portal 5,2, but current task is for in-portal 5.3 version. Maybe, there is error in the test plan.

You need to apply the patch manually (look at what's changed in Phabricator and perform the same changes in the PhpStorm).

P.S.
I've called the Erik and we're able to resolve this using the screen sharing.

This revision was automatically updated to reflect the committed changes.