Skip to content

Commit

Permalink
fix: handle JSON error handling (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
mercs600 committed Nov 8, 2023
1 parent 632b88b commit ee78539
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions example/layouts/error.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<template>
<div>
<h1>ERROR PAGE {{ error.statusCode }}</h1>
<h1>ERROR PAGE {{ error.message }}</h1>

<t3-dynamic
v-if="t3page"
v-if="t3page && t3page.content"
:data="t3page.content"
:type="t3page.appearance.backendLayout"
layout
Expand Down
2 changes: 1 addition & 1 deletion lib/lib/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function setErrorContext (context, httpError) {
const { error } = context
const errorContext = {
ssr: null,
message: httpError.response?.message || httpError.message,
message: httpError.response?.data?.reason || httpError.response?.message || httpError.message,
statusCode: httpError.response?.status || 500,
rawError: httpError
}
Expand Down

0 comments on commit ee78539

Please sign in to comment.