Skip to content

docs: Update Error Handling section of chat_append() #48

@gadenbuie

Description

@gadenbuie

I missed that ?chat_append() included instructions for handling the rejected promise. (In my defense, I don't think I'm alone in this.)

shinychat/R/chat.R

Lines 172 to 180 in 98973d3

#' # Error handling
#'
#' If the `response` argument is a generator, promise, or promise generator, and
#' an error occurs while producing the message (e.g., an iteration in
#' `stream_async` fails), the promise returned by `chat_append` will reject with
#' the error. If the `chat_append` call is the last expression in a Shiny
#' observer, Shiny will see that the observer failed, and end the user session.
#' If you prefer to handle the error gracefully, use [promises::catch()] on the
#' promise returned by `chat_append`.

The general idea is still correct, except that the error no longer brings down the app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions