Skip to content

Commit

Permalink
Fix two more type errors (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Mar 14, 2021
1 parent 12a885b commit 6c4e153
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/kit/src/runtime/client/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class Renderer {

/**
* @param {import('./types').NavigationTarget} selected
* @param {string[]} chain
* @param {string[]} [chain]
*/
async render(selected, chain) {
const token = (this.token = {});
Expand All @@ -182,7 +182,7 @@ export class Renderer {
hydrated.props.error = new Error('Redirect loop');
} else {
this.router.goto(hydrated.redirect, { replaceState: true }, [
...chain,
...(chain || []),
this.current.page.path
]);

Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/runtime/server/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async function get_response({ request, options, $session, route, status = 200, e
// error page, there's not a lot we can do
if (error) throw e instanceof Error ? e : new Error(e);

loaded = { error: e instanceof Error ? e : { message: e.toString() }, status: 500 };
loaded = { error: e instanceof Error ? e : { name: 'Error', message: e.toString() }, status: 500 };
}

if (loaded) {
Expand Down Expand Up @@ -276,7 +276,7 @@ async function get_response({ request, options, $session, route, status = 200, e
$session,
route,
status: 500,
error: e instanceof Error ? e : { message: e.toString() }
error: e instanceof Error ? e : { name: 'Error', message: e.toString() }
});
}

Expand Down

0 comments on commit 6c4e153

Please sign in to comment.