Skip to content

Plain-text view of stack traces at the top of HTML response, in a comment #32766

@GKFX

Description

@GKFX

(feature request)
Description
Symfony has a very nice and easy to use HTML view of exceptions. However, it is not unusual to see the HTML source of those pages dumped into a developer's console, for example as a result of interacting with the server using curl or any other console-based workflow. The stack trace is then hard to read as the dev has to skim past all the HTML.

My request is for a HTML comment to be included near the start of the page (I guess as high as possible without causing problems, which I think is directly under under the <meta charset="UTF-8" />) containing the stack trace in a plain text format. This would obviously be invisible when viewing the traces as intended in a browser, but would significantly increase reading speed at the console.

Example
After I've made a syntax error in my file AccountController.php, and then made a request with curl, the returned error page should be

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
<!--
(1/1) FatalThrowableError
Parse error: syntax error, unexpected ';', expecting ')'
in AccountController.php line 76
at DebugClassLoader->loadClass('Acts\\CamdramSecurityBundle\\Controller\\AccountController')
at spl_autoload_call('Acts\\CamdramSecurityBundle\\Controller\\AccountController')
at ReflectionClass->__construct('Acts\\CamdramSecurityBundle\\Controller\\AccountController') in ReflectionClassResource.php line 109
at ReflectionClassResource->computeHash() in ReflectionClassResource.php line 48
at ReflectionClassResource->isFresh(1564166958) in SelfCheckingResourceChecker.php line 34
at SelfCheckingResourceChecker->isFresh(object(ReflectionClassResource), 1564166958) in ResourceCheckerConfigCache.php line 99
at ResourceCheckerConfigCache->isFresh()in ConfigCache.php line 60
at ConfigCache->isFresh()in Kernel.php line 579
at Kernel->initializeContainer()in Kernel.php line 135
at Kernel->boot()in Kernel.php line 195
at Kernel->handle(object(Request))in app_dev.php line 30
at require('/home/me/project-name/web/app_dev.php')in router.php line 42
-->
        <meta name="robots" content="noindex,nofollow" />
        <style>
/* page continues as normal ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRFCRFC = Request For Comments (proposals about features that you want to be discussed)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions