15 lines
379 B
JavaScript
15 lines
379 B
JavaScript
import { redirect } from "@sveltejs/kit";
|
|
|
|
/** @type {import('@sveltejs/kit').HandleServerError} */
|
|
export async function handleError({ error, status }) {
|
|
// for unknown routes, just redirect to /
|
|
if (status === 404) {
|
|
return redirect(303, "/");
|
|
}
|
|
|
|
// for other errors, pass the message which will be used by the error page
|
|
return {
|
|
message: `${error}`,
|
|
};
|
|
}
|