Table of Contents
onChatMessageError()
wrtc.onChatMessageError() is an event function called when an error occurred while sending a chat message.
You must write your own wrtc.onChatMessageError() function to be able to tell user something went wrong.
Arguments
wrtc.onChatMessageError(err)
- err - JSON structure containing received error: {fromAddress:…, errorCode:…, errorMsg:…}
- fromAddress - address message was sent from eg "john.doe@company.com"
- errorCode - error number
- errorMsg - error description in english
The most common error is 404 (Not found) if you try to send a chat message to an unknown recipient.
Return value
Ignored.
Example
{type:"chat", fromAddress:"foo@bar.com", errorCode:"404", errorMsg:"Not Found"}
wrtc.onChatMessageError = function(err) {
window.alert(err.fromAddress + ": error " + err.errorCode + ": " + err.errorMsg);
}