App — Message Error
The LiSA Player sends an Error message if it encounters a message that cannot be parsed successfully.
This message is sent by the LiSA Player to the host app / environment.
Properties
Along with all standard Message properties, a Message Error message includes the following additional properties:
Name
Type
Description
error
MessageError
Required.
The error
property specifies the issue that occurred during message parsing.
Refer to MessageError
for detailed information.
messageType
Literal
Required.
lsc:app:message:error
Type Definition
interface AppMessageAcknowledgeMessage extends Omit<
Message,
'messageType' | 'sender'
> {
error: MessageError;
messageType: 'lsc:app:message:error';
sender: 'LiSA';
}
MessageError
MessageError
The LiSA Player uses Zod to parse incoming messages. For details on the ZodIssue
type, refer to the Zod documentation.
interface MessageError {
/** The distinct human-readable error code. */
code: string;
/** A message describing the error that occurred. */
message: string;
/** A status code, typically 400 to indicate a bad request. */
statusCode: number;
/** The payload of the original message that the player failed to parse. */
input: unknown;
/** A list, providing detailed information on the issues identified. */
issues: ZodIssue[];
/**
* The unique identifier of the message that the player failed to parse,
* if provided.
*/
messageId?: string;
}
Examples
Pass User Context message, that misses the id
property.
{
"clockDriftInMs": 0,
"error": {
"code": "ParseError",
"message": "Failed to parse message",
"statusCode": 400,
"input": {
"messageId": "2a0e5ddc-a3ea-4a43-aff0-be07bdb55077",
"messageType": "lsc:visitor:pass-user-context",
"sender": "Sender",
"recipient": "LiSA",
"displayName": "Jane Doe",
"isCommentsConsentRequired": false
},
"issues": [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"id"
],
"message": "Required"
}
],
"messageId": "2a0e5ddc-a3ea-4a43-aff0-be07bdb55077"
},
"messageType": "lsc:app:message:error",
"sender": "LiSA"
}
Last updated