This guide will cover displaying and controlling behavior around flow errors. Within Descope screens, if an external error
is provided during an action, you can transform the error to be a more consumable error for your end user. Outside of screens, you can route
based on errors.
import { AuthProvider } from '@descope/react-sdk'import { Descope, useDescope } from '@descope/react-sdk'const AppRoot = () => { return ( <AuthProvider projectId="__ProjectID__" // If the Descope project manages the token response in cookies, // a custom domain must be configured // (e.g., https://auth.app.example.com) // and should be set as the baseUrl property. // baseUrl = "https://auth.app.example.com" > <App /> </AuthProvider> );};
(1) Auto-handling: If a widget is not linked to something, the error is automatically presented in the most recent flow screen step.
(2) Specifically Exposed Errors: Certain widgets have hard-coded error handling, allowing the Descoper to configure the output.
(3) Custom Error Handling: Errors thrown in widgets that are not caught automatically are exposed as generic, allowing the Descoper to route to a desired screen or action.
By adjusting the Error Handling in the configuration of a widget from Automatic to Custom, the ability to route to a particular action, screen, condition, or connector will show up.