From cd58b1c896a058576066bd8bd8962ef427383a32 Mon Sep 17 00:00:00 2001 From: Christopher Giffard Date: Thu, 19 Sep 2013 12:50:06 +1000 Subject: [PATCH] 500 Series Error Handling & Stack Traces Fixes #825 - Changes the way the error middleware is delivered in server.js, moving all the logic back into errorHandling.js - Alters error logging to use console.error (probably more appropriate) instead of console.log - Changes error tests to accomodate for these alterations - Alters user-error and error hbs templates to incorporate stack traces - Adds additional styling for error pages to accomodate stack traces - Added logic to parse and deliver formatted stack traces Notes: ====== - Jslint gets in the way of the regex I've got to use to parse the stack. (It cites 'security reasons' which are not relevant in this case.) I needed to add a condition to relax it at the top of errorHandling.js - The stack trace should probably be added as a partial, but I figured it was out of scope for this PR. --- ghost/admin/assets/sass/layouts/errors.scss | 31 +++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/ghost/admin/assets/sass/layouts/errors.scss b/ghost/admin/assets/sass/layouts/errors.scss index 77138bfcab..bc70c351a6 100644 --- a/ghost/admin/assets/sass/layouts/errors.scss +++ b/ghost/admin/assets/sass/layouts/errors.scss @@ -77,10 +77,31 @@ } } -/* ============================================================================= - 404 - ============================================================================= */ +.error-stack { + margin: 1em auto; + padding: 2em; + max-width: 800px; + background-color: rgba(255,255,255,0.3); +} -.error-404 { - width: 300px; +.error-stack-list { + list-style-type: none; + padding: 0; + margin: 0; +} + +.error-stack-list li { + display: block; + + &::before { + color: #BBB; + content: "↪︎"; + display: inline-block; + font-size: 1.2em; + margin-right: 0.5em; + } +} + +.error-stack-function { + font-weight: bold; } \ No newline at end of file