[GH-ISSUE #8772] how to catch exception from a pipe to render the toast.error like in router/openai #118559

Closed
opened 2026-05-20 19:54:44 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @sir3mat on GitHub (Jan 22, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8772

Bug Report

Issue Description

When streaming data from a pipe to OpenWebUI, exceptions raised by the pipe are not properly captured or propagated to trigger a toast.error in the OpenWebUI chat UI. This behavior is inconsistent with the router/openai endpoint, where exceptions are properly surfaced to the UI.

Steps to Reproduce

  1. Set up a pipe to stream data to OpenWebUI.

  2. Raise an exception from the pipe during the streaming process.

  3. Observe that the exception is not propagated to the UI as a toast.error notification.

Expected Behavior

The exception raised from the pipe should trigger the same toast.error behavior in the OpenWebUI chat UI as when an exception is raised from the router/openai endpoint.

Code Reference

The issue seems to occur in the following code snippet: 568dbc545c/backend/open_webui/functions.py (L278)

Observations

In router/openai, exceptions raised by the OpenAI endpoint result in a toast.error notification in the UI. However, this behavior is not observed when exceptions are raised from a pipe during streaming.

Questions

  1. How can exceptions raised from a pipe during streaming be captured and propagated to the UI to achieve consistent behavior with the router/openai endpoint?

  2. Are there specific mechanisms or error-handling structures that need to be implemented to ensure this behavior?

Originally created by @sir3mat on GitHub (Jan 22, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8772 Bug Report Issue Description When streaming data from a pipe to OpenWebUI, exceptions raised by the pipe are not properly captured or propagated to trigger a toast.error in the OpenWebUI chat UI. This behavior is inconsistent with the router/openai endpoint, where exceptions are properly surfaced to the UI. Steps to Reproduce 1. Set up a pipe to stream data to OpenWebUI. 2. Raise an exception from the pipe during the streaming process. 3. Observe that the exception is not propagated to the UI as a toast.error notification. Expected Behavior The exception raised from the pipe should trigger the same toast.error behavior in the OpenWebUI chat UI as when an exception is raised from the router/openai endpoint. Code Reference The issue seems to occur in the following code snippet: https://github.com/open-webui/open-webui/blob/568dbc545cdd7e1d08e0db7851bace82db04a418/backend/open_webui/functions.py#L278 Observations In router/openai, exceptions raised by the OpenAI endpoint result in a toast.error notification in the UI. However, this behavior is not observed when exceptions are raised from a pipe during streaming. Questions 1. How can exceptions raised from a pipe during streaming be captured and propagated to the UI to achieve consistent behavior with the router/openai endpoint? 2. Are there specific mechanisms or error-handling structures that need to be implemented to ensure this behavior?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#118559