chore: Improve error page (#66)

* chore: Improve error page

* fix: Fix middlware order

* fix: Remove console.log
This commit is contained in:
Khaled Garbaya
2017-11-15 14:01:54 +01:00
committed by GitHub
parent 3a78027c28
commit f45c65c111
6 changed files with 54 additions and 37 deletions

View File

@@ -9,15 +9,23 @@ block content
h1 #{translate('somethingWentWrongLabel', currentLocale.code)} (#{error.status})
h2 #{translate('tryLabel', currentLocale.code)}:
ul
li #{translate('contentModelChangedErrorLabel', currentLocale.code)}
li #{translate('draftOrPublishedErrorLabel', currentLocale.code)}
li #{translate('localeContentErrorLabel', currentLocale.code)}
li #{translate('verifyCredentialsErrorLabel', currentLocale.code)}
case error.status
when 404
li #{translate('error404Route', currentLocale.code)}
li #{translate('draftOrPublishedErrorLabel', currentLocale.code)}
when 400
li #{translate('contentModelChangedErrorLabel', currentLocale.code)}
when 401
li #{translate('verifyCredentialsErrorLabel', currentLocale.code)}
li #{translate('localeContentErrorLabel', currentLocale.code)}
if error.stack
li #{translate('stackTraceErrorLabel', currentLocale.code)}
if error.response
h2 #{translate('errorLabel', currentLocale.code)}
pre.error__stack-trace
code.shell #{helpers.dump(error.response.data)}
h2 #{translate('stackTraceLabel', currentLocale.code)}
pre.error__stack-trace
code.shell #{error.stack}
if error.stack
h2 #{translate('stackTraceLabel', currentLocale.code)}
pre.error__stack-trace
code.shell #{error.stack}

View File

@@ -1,6 +1,7 @@
mixin breadcrumb
nav.breadcrumb
ul
each item in breadcrumb
li
a(href=`${item.url}${queryString}`) #{item.label}
if breadcrumb
nav.breadcrumb
ul
each item in breadcrumb
li
a(href=`${item.url}${queryString}`) #{item.label}