Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are reading the archived C1 by Thesys docs. New projects should use the OpenUI docs.
Pass custom onError callback to handle application level errors gracefully
onError
C1Component
import { C1Component } from "@thesysai/genui-sdk"; <C1Component c1Response={c1Response} onError={({ code, c1Response }) => { console.error(`C1 Error: ${code}`, c1Response); }} />
code
number
c1Response
string
import { C1Component } from "@thesysai/genui-sdk"; import { useState } from "react"; function App() { const [error, setError] = useState<{ code: number; message: string } | null>(null); if (error) { return ( <div className="error-state"> Something went wrong (Error {error.code}). Please try again. </div> ); } return ( <C1Component c1Response={c1Response} onError={({ code, c1Response }) => { console.error(`C1 Error: ${code}`, c1Response); setError({ code, message: c1Response }); }} /> ); }
Was this page helpful?