Errors
Archived SDK documentation
This page preserves the previous SDK documentation and its existing URL. The generated API reference was produced from SDK 0.1.5, source commit 4db9fbe925bf07a4b95e936a5bb172d6ab5820bb. Handbook behavior and compatibility claims below are historical descriptions, not a newly verified support guarantee. For the reviewed version-specific reference, see the SDK 0.1.5 overview.
The SDK throws typed errors that you can match with instanceof. All errors live on the package root export.
import {
CapabilityNotSupportedError,
ReadAloudCapabilityNotFoundError,
SessionOpenError,
SessionClosedError,
ChannelTransportError,
} from '@ki-kombinat/delphi-client-js-sdk';
Typed errors
| Error | When | Key fields |
|---|---|---|
CapabilityNotSupportedError | assertCapability / assertEndpointCapability and the endpoint doesn't expose the capability. | capability, endpointId |
ReadAloudCapabilityNotFoundError | readAloud cannot resolve a read-aloud BOA on the endpoint (none registered, or capabilityId / identifier doesn't match). | endpointId, capabilityId? |
SessionOpenError | The session-token request, the gateway handshake, or the SIP plugin attach failed. | cause, mode, endpointId |
SessionClosedError | Method invoked on a session that has already closed (idle timeout, explicit close, or transport failure past the reconnect window). | mode, endpointId |
ChannelTransportError | The channel WebSocket failed and the reconnect window expired. | code, reason |
Pattern
import {
CapabilityNotSupportedError,
ReadAloudCapabilityNotFoundError,
} from '@ki-kombinat/delphi-client-js-sdk';
try {
await delphi.readAloud(text, {endpointId});
} catch (err) {
if (err instanceof CapabilityNotSupportedError) {
console.warn(`Endpoint ${err.endpointId} does not support ${err.capability}.`);
return;
}
if (err instanceof ReadAloudCapabilityNotFoundError) {
console.warn('Endpoint has no read-aloud BOA registered.');
return;
}
throw err;
}
Server-side errors
Errors originating on the server arrive as ChannelMessage with type: 'error' and error: ErrorPayload. The SDK maps recognised codes onto the typed-error classes above; unknown codes surface as the raw payload via the session's lastError. See Channel protocol.