We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5453dc commit fab7227Copy full SHA for fab7227
src/lib/error.ts
@@ -16,8 +16,14 @@ export async function forwardError(c: Context, error: unknown) {
16
consola.error("Error occurred:", error)
17
18
if (error instanceof HTTPError) {
19
- consola.error("HTTP error:", await error.response.json())
20
const errorText = await error.response.text()
+ let errorJson: unknown
21
+ try {
22
+ errorJson = JSON.parse(errorText)
23
+ } catch {
24
+ errorJson = errorText
25
+ }
26
+ consola.error("HTTP error:", errorJson)
27
return c.json(
28
{
29
error: {
0 commit comments