Log tRPC errors in all environments
Previously only logged in development mode, making production debugging impossible. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,12 +43,9 @@ const handler = (req: Request) => {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError:
|
onError: ({ path, error }) => {
|
||||||
process.env.NODE_ENV === 'development'
|
console.error(`tRPC failed on ${path ?? '<no-path>'}:`, error.message)
|
||||||
? ({ path, error }) => {
|
},
|
||||||
console.error(`❌ tRPC failed on ${path ?? '<no-path>'}:`, error)
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user