replace 4xx.html and 5xx.html with _error.html

This commit is contained in:
Rich Harris
2018-06-28 11:38:21 -04:00
parent 0aeb63a05b
commit e87247493f
10 changed files with 38 additions and 46 deletions

View File

@@ -1,6 +0,0 @@
<svelte:head>
<title>Internal server error</title>
</svelte:head>
<h1>Internal server error</h1>
<p>{error.message}</p>

View File

@@ -2,5 +2,5 @@
<title>{status}</title>
</svelte:head>
<h1>Not found</h1>
<h1>{status}</h1>
<p>{error.message}</p>

View File

@@ -19,7 +19,7 @@
return this.error(500, 'something went wrong');
}
return fetch(`blog/${slug}.json`).then(r => {
return fetch(`blog/${slug}.json`).then(async r => {
if (r.status === 200) {
return r.json().then(post => ({ post }));
this.error(r.status, '')