naystack - v1.5.10
    Preparing search index...

    Function handleError

    • Creates a NextResponse for an error, or delegates to a custom onError handler if provided. Used internally by auth routes for consistent error handling.

      Parameters

      • status: number

        HTTP status code.

      • message: string

        Error message body.

      • OptionalonError: ErrorHandler

        Optional custom handler; if it returns a Response, that is used instead of the default.

      Returns NextResponse<unknown>

      NextResponse with the given status and message, or the custom handler's response.