@inworld/web-core
Version:
47 lines (46 loc) • 1.64 kB
TypeScript
import { ProtoError } from '../common/data_structures/index.js';
export declare enum ErrorType {
SESSION_TOKEN_EXPIRED = "SESSION_TOKEN_EXPIRED",
SESSION_TOKEN_INVALID = "SESSION_TOKEN_INVALID",
SESSION_RESOURCES_EXHAUSTED = "SESSION_RESOURCES_EXHAUSTED",
BILLING_TOKENS_EXHAUSTED = "BILLING_TOKENS_EXHAUSTED",
ACCOUNT_DISABLED = "ACCOUNT_DISABLED",
SESSION_INVALID = "SESSION_INVALID",
RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND",
SAFETY_VIOLATION = "SAFETY_VIOLATION",
SESSION_EXPIRED = "SESSION_EXPIRED",
AUDIO_SESSION_EXPIRED = "AUDIO_SESSION_EXPIRED",
SESSION_PAUSED = "SESSION_PAUSED"
}
export declare enum ErrorReconnectionType {
UNDEFINED = "UNDEFINED",
NO_RETRY = "NO_RETRY",
IMMEDIATE = "IMMEDIATE",
TIMEOUT = "TIMEOUT"
}
export declare enum ErrorResourceType {
RESOURCE_TYPE_UNDEFINED = "RESOURCE_TYPE_UNDEFINED",
RESOURCE_TYPE_CONVERSATION = "RESOURCE_TYPE_CONVERSATION"
}
interface ResourceNotFoundDetails {
resourceId?: string;
resourceType?: ErrorResourceType;
}
export interface InworldStatus {
errorType?: ErrorType;
reconnectTime?: string;
reconnectType?: ErrorReconnectionType;
maxRetries?: number;
resourceNotFound?: ResourceNotFoundDetails;
}
export declare class InworldError {
message: string;
code: string | undefined;
details: InworldStatus[];
constructor(message: string, code?: string, details?: InworldStatus[]);
static fromProto(proto: ProtoError): InworldError;
private static getErrorType;
private static getErrorReconnectionType;
private static getErrorResourceType;
}
export {};