Skip to content

[ExceptionRender] - Outputting web exceptions in CLI #130

@cnizzardini

Description

@cnizzardini

What Happened

Web exceptions (html) output to CLI when an exception is encountered running a command.

Expected Behavior

CLI exceptions are displayed.

Steps to Reproduce

  1. Throw an exception in a cake command

Proposed change:

    public function render(): ResponseInterface
    {
        if (PHP_SAPI === 'cli') {
            $request = $request ?? Router::getRequest();
            return (new ConsoleExceptionRenderer($this->error, $request, $this->_config))->render();
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions