Include error message text on page
Also remove the '500' h1 from the error Closes #3248
This commit is contained in:
parent
ae1577b228
commit
0d8d816a0c
@ -50,7 +50,7 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
env: { browser: true, es2020: true },
|
||||
ignorePatterns: ["backend_proto.d.ts", "*.svelte.d.ts", "vendor", "extra/*", "vite.config.ts"],
|
||||
ignorePatterns: ["backend_proto.d.ts", "*.svelte.d.ts", "vendor", "extra/*", "vite.config.ts", "hooks.client.js"],
|
||||
globals: {
|
||||
globalThis: false,
|
||||
NodeListOf: false,
|
||||
|
11
ts/routes/+error.svelte
Normal file
11
ts/routes/+error.svelte
Normal file
@ -0,0 +1,11 @@
|
||||
<!--
|
||||
Copyright: Ankitects Pty Ltd and contributors
|
||||
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { page } from "$app/stores";
|
||||
|
||||
$: message = $page.error!.message;
|
||||
</script>
|
||||
|
||||
{message}
|
8
ts/src/hooks.client.js
Normal file
8
ts/src/hooks.client.js
Normal file
@ -0,0 +1,8 @@
|
||||
/** @type {import('@sveltejs/kit').HandleClientError} */
|
||||
export async function handleError({ error, event, status, message }) {
|
||||
/** @type {any} */
|
||||
const anyError = error;
|
||||
return {
|
||||
message: anyError.message,
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user