Skip to content

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:

  1. A Frame has a <Button>
  2. When the user presses the button in the App, the App will make a POST request to the specified route.
  3. The App responds with a 400 status code and error message.
  4. 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()
 
app.frame('/', (c) => {
  return c.error({/* ... */})
})