mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What Handling server action errors capturing in instrumentation.js `onRequestError` API Closes NDX-21
14 lines
300 B
JavaScript
14 lines
300 B
JavaScript
export function onRequestError(err, request, context) {
|
|
fetch(`http://localhost:${process.env.PORT}/write-log`, {
|
|
method: 'POST',
|
|
body: JSON.stringify({
|
|
message: err.message,
|
|
request,
|
|
context,
|
|
}),
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
})
|
|
}
|