Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential improvements to redirect-frame/app/api/frame/route.ts #5

Open
valentineejimole opened this issue Oct 23, 2024 · 0 comments
Open

Comments

@valentineejimole
Copy link

There needs to be improvement on this code for proper error handling

Add Error Handling: Include error handling in case the redirect fails or if there are issues with the request.

async function getResponse(req: NextRequest): Promise<NextResponse> {
try {
return NextResponse.redirect('https://redirect-frame.vercel.app/redirect', { status: 302 });
} catch (error) {
console.error('Error during redirect:', error);
return NextResponse.error();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant