Exception rendering doesn't load a full html page.
Throw an exception
\Exception\Handler->renderExceptionWithSymfony returns $renderer->getBody which does not return a full html page. It looks like a full page was returned by the exception handler up until version 6.
@GrahamCampbell do you know what's going on here?
I can take a look. @mblaney are you saying that it was working fine in Lumen 6, but not 7?
Yes only started happening after an update. Made a temporary fix by changing which Symfony template gets used.
I can't see anything wrong. The full error page gets returned?
curl http://localhost:8000/123
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="robots" content="noindex,nofollow,noarchive" />
<title>An Error Occurred: Not Found</title>
<style>body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; }
.container { margin: 30px; max-width: 600px; }
h1 { color: #dc3545; font-size: 24px; }
h2 { font-size: 18px; }</style>
</head>
<body>
<div class="container">
<h1>Oops! An Error Occurred</h1>
<h2>The server returned a "404 Not Found".</h2>
<p>
Something is broken. Please let us know what you were doing when this error occurred.
We will fix it as soon as possible. Sorry for any inconvenience caused.
</p>
</div>
</body>
</html>
Oh, you mean when debug=true is enabled. I can replicate this now.
Yeah errors are ok you need to throw an exception to render the stack trace.
Ah yeah that too.
That was a thrown exception. Error 404's are implemented by throwing an exception. ;)
Hmmm, did you have a specific fix in mind?
From what I can see, we are calling the same rendering code the symfony error handler calls?
AH, wait, I see...
https://github.com/laravel/lumen-framework/pull/1054 should fix this for you.
awesome! thanks :-)