From 7943a81ad938fdc0782caf7b2eb61de043139df7 Mon Sep 17 00:00:00 2001 From: zxv Date: Wed, 13 May 2015 23:05:57 -0400 Subject: [PATCH 1/3] Update error_status to HTTP status code 200 instead of 500, Update SASS error style --- sassutils/wsgi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sassutils/wsgi.py b/sassutils/wsgi.py index 5a349458..f6c541f4 100644 --- a/sassutils/wsgi.py +++ b/sassutils/wsgi.py @@ -92,7 +92,7 @@ class SassMiddleware(object): """ def __init__(self, app, manifests, package_dir={}, - error_status='500 Internal Server Error'): + error_status='200 OK'): if not callable(app): raise TypeError('app must be a WSGI-compliant callable object, ' 'not ' + repr(app)) @@ -143,7 +143,9 @@ def __call__(self, environ, start_response): b'/*\n', str(e).encode('utf-8'), b'\n*/\n\n', b'body:before { content: ', self.quote_css_string(str(e)).encode('utf-8'), - b'; color: maroon; background-color: white; }' + b'; color: maroon; background-color: white', + b'; white-space: pre-wrap; display: block; ', + b'font-family: "Courier New"; user-select: text; }' ] def read_file(path): From 15fa6d11be1925bbd1dd89e4201886a203153f24 Mon Sep 17 00:00:00 2001 From: zxv Date: Wed, 13 May 2015 23:26:46 -0400 Subject: [PATCH 2/3] Errors now display using browser's default monospace font, using Courier New as a fallback --- sassutils/wsgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sassutils/wsgi.py b/sassutils/wsgi.py index f6c541f4..ac69b870 100644 --- a/sassutils/wsgi.py +++ b/sassutils/wsgi.py @@ -145,7 +145,7 @@ def __call__(self, environ, start_response): self.quote_css_string(str(e)).encode('utf-8'), b'; color: maroon; background-color: white', b'; white-space: pre-wrap; display: block; ', - b'font-family: "Courier New"; user-select: text; }' + b'font-family: monospace, "Courier New"; user-select: text; }' ] def read_file(path): From cc24ecccbb1ce564b3f1b9d271e07abbc151aeee Mon Sep 17 00:00:00 2001 From: zxv Date: Fri, 15 May 2015 08:04:46 -0400 Subject: [PATCH 3/3] Reversed order of font declarations --- sassutils/wsgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sassutils/wsgi.py b/sassutils/wsgi.py index ac69b870..3b12283b 100644 --- a/sassutils/wsgi.py +++ b/sassutils/wsgi.py @@ -145,7 +145,7 @@ def __call__(self, environ, start_response): self.quote_css_string(str(e)).encode('utf-8'), b'; color: maroon; background-color: white', b'; white-space: pre-wrap; display: block; ', - b'font-family: monospace, "Courier New"; user-select: text; }' + b'font-family: "Courier New", monospace; user-select: text; }' ] def read_file(path):