Skip to main content

ConversationError

ug-js-sdk


ug-js-sdk / ConversationError

Interface: ConversationError

Defined in: types/index.ts:360

Error information when something goes wrong in the conversation.

Example

hooks: {
onError: (error) => {
switch (error.type) {
case 'mic_denied':
alert('Please allow microphone access')
break
case 'network_error':
console.error('Connection lost:', error.message)
break
}
}
}

Properties

type

type: "mic_denied" | "network_timeout" | "network_error" | "server_error" | "decode_error"

Defined in: types/index.ts:369

Error type:

  • mic_denied - User denied microphone permission
  • network_timeout - Request timed out
  • network_error - WebSocket connection error
  • server_error - Server returned an error
  • decode_error - Failed to decode audio data

message

message: string

Defined in: types/index.ts:371

Human-readable error message


originalError?

optional originalError: Error

Defined in: types/index.ts:373

Original error object if available