mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 03:14:03 +03:00
8680099765
refs #8222 - differentiate between errors and fatal errors - use gscan errors in theme middleware - Adds a new `error()` method to `currentActiveTheme` constructor which will return the errors we receive from gscan - In middleware, if a theme couldn't be activated because it's invalid, we'll fetch the erros and send them to our error handler. We also use a new property `hideStack` to control, if the stack (in dev mode and if available) should be shown or the gscan errors (in prod mode, or in dev if no stack error) - In our error handler we use this conditional to send a new property `gscan` to our error theme - In `error.hbs` we'll iterate through possible `gscan` error objects and render them. - remove stack printing - stack for theme developers in development mode doesn't make sense - stack in production doesn't make sense - the stack is usually hard to read - if you are developer you can read the error stack on the server log - utils.packages: transform native error into Ghost error - use `onlyFatalErrors` for gscan format and differeniate fatal errors vo.2 - optimise bootstrap error handling - transform theme is missing into an error - add new translation key - show html tags for error.hbs template: rule
64 lines
2.6 KiB
Handlebars
64 lines
2.6 KiB
Handlebars
<!doctype html>
|
|
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
|
|
<!--[if (gte IE 9)| IEMobile |!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
|
|
<title>{{code}} — {{message}}</title>
|
|
|
|
<meta name="HandheldFriendly" content="True">
|
|
<meta name="MobileOptimized" content="320">
|
|
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
|
|
<link rel="shortcut icon" href="{{asset "favicon.ico"}}">
|
|
<meta http-equiv="cleartype" content="on">
|
|
|
|
<link rel="stylesheet" href="{{asset "public/ghost.css" hasMinFile="true"}}"/>
|
|
|
|
</head>
|
|
<body>
|
|
<main role="main" id="main">
|
|
<div class="gh-app">
|
|
<div class="gh-viewport">
|
|
<div class="gh-view">
|
|
<section class="error-content error-404 js-error-container">
|
|
<section class="error-details">
|
|
<img
|
|
class="error-ghost"
|
|
src="{{asset "public/404-ghost@2x.png"}}"
|
|
srcset="{{asset "public/404-ghost.png"}} 1x, {{asset "public/404-ghost@2x.png"}} 2x"/>
|
|
<section class="error-message">
|
|
<h1 class="error-code">{{code}}</h1>
|
|
<h2 class="error-description">{{message}}</h2>
|
|
<a class="error-link" href="{{@blog.url}}">Go to the front page →</a>
|
|
</section>
|
|
</section>
|
|
</section>
|
|
|
|
{{#if errorDetails}}
|
|
<section class="error-stack">
|
|
<h3>Theme errors</h3>
|
|
|
|
<ul class="error-stack-list">
|
|
{{#each errorDetails}}
|
|
<li>
|
|
<em class="error-stack-function">{{{rule}}}</em>
|
|
|
|
{{#each failures}}
|
|
<p><span class="error-stack-file">Ref: {{ref}}</span></p>
|
|
<p><span class="error-stack-file">Message: {{message}}</span></p>
|
|
{{/each}}
|
|
</li>
|
|
{{/each}}
|
|
</ul>
|
|
</section>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</body>
|
|
</html>
|