What if sending email failed?

For the code below, what if sendEmail failed, how can i catch the error on client side?
import { betterAuth } from "better-auth"
import { emailOTP } from "better-auth/plugins"
 
export const auth = betterAuth({
    // ... other config options
    plugins: [
        emailOTP({ 
                async sendVerificationOTP({ email, otp, type}) { 
                    sendEmail(email, opt);
        }, 
        }) 
    ]
})


I am using resend, and got a error for resend when sending email:
{
  statusCode: 403,
  message: "...",
  name: 'validation_error'
}

but I can not get the error on client side.
Was this page helpful?