Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
7.26k stars 958 forks source link

Serving custom error pages #1537

Open dominpm opened 6 days ago

dominpm commented 6 days ago

Feature Request: Custom HTTP Error Pages

Summary:
Enable users to define and return custom error pages for HTTP errors within the Chainlit framework.

Description:
Currently, when HTTP errors occur in Chainlit applications, default error pages are displayed. This feature request proposes the ability for developers to create and return their own custom error pages. This enhancement would allow for more user-friendly error handling and a consistent user experience aligned with the application's branding.

Key Features:

  1. Custom Error Page Configuration:

    • Allow developers to specify custom HTML, CSS, and JavaScript for error pages.
    • Provide configuration options within the Chainlit settings to map specific HTTP error codes (e.g., 404, 500) to custom pages.
  2. Template Support:

    • Support for templating engines (e.g., Jinja2) to dynamically render error pages with context-specific information.

Benefits: