Skip to content

Documentation on handling SendMessageError #806

@michaeltnguyen

Description

@michaeltnguyen

Give us your feedback about our samples

Which sample do you want to give feedback?

https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-web-pubsub/reference-client-sdk-javascript.md#4-send-messages-to-a-group

The sample is not what you want?

In production, we have occasionally run into the following error:

Type: SendMessageError
Message: The connection is not connected.
File:
Stack: SendMessageError: The connection is not connected.
at aVn._sendMessageWithAckId @
at async aVn._sendToGroupAttempt @
at async aVn._operationExecuteWithRetry @
at async aVn.sendToGroup

What is the proper way to handle this error?

Should we be checking the connection status before calling sendAsync? In other words, track status via client.on('connected') and client.on('disconnected'). And in that case, while the status is "disconnected", we would need to store all attempted messages so they can be resent once the client has successfully connected? Or does this library do all of that for us already?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions