Files
Jiachi LiuandGitHub f2adcfeb16 Handle server actions error in onRequestError (#67769)
### What

Handling server action errors capturing in instrumentation.js
`onRequestError` API

Closes NDX-21
2024-07-16 20:47:47 +02:00

16 lines
285 B
JavaScript

'use server'
import { notFound, redirect } from 'next/navigation'
export async function redirectAction() {
redirect('/another')
}
export async function notFoundAction() {
notFound()
}
export async function serverLog(content) {
throw new Error('[server-action]:' + content)
}