Error Handling
Farcaster Frames have the ability to return application-level error messages (see the spec). This is the best way for frame developers to give users feedback in response to an input or other requirements.
Overview
At a glance:
- A Frame has a
<Button>
- When the user presses the button in the App, the App will make a
POST
request to the specified route. - The App responds with a
400
status code and error message. - The client displays the error message to the user.
Frog supports error messages for frames, transactions, and cast actions.
Reference
Frame Error
import { Frog } from 'frog'
export const app = new Frog({ title: 'Frog Frame' })
app.frame('/', (c) => {
return c.error({/* ... */})
})