Skip to content

Commit

Permalink
fix(start): small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
danecando committed Oct 23, 2024
1 parent 6baa23a commit f25e09d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/start/src/client-runtime/fetcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,10 @@ async function handleResponseErrors(response: Response) {
return await response.text()
})()

const message = `Request failed with status ${response.status}`
const defaultMessage = `Request failed with status ${response.status}`
const message = body?.message || body || defaultMessage

if (isJson) {
throw new Error(body.message || message)
} else {
throw new Error(body || message)
}
throw new Error(message)
}

return response
Expand Down

0 comments on commit f25e09d

Please sign in to comment.