{"version":3,"file":"errors.mjs","sources":["../../../src/room/errors.ts"],"sourcesContent":["import { DisconnectReason, RequestResponse_Reason } from '@livekit/protocol';\n\n/** Base error that all LiveKit specific custom errors inherit from. */\nexport class LivekitError extends Error {\n  code: number;\n\n  // More info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause\n  cause?: unknown;\n\n  constructor(code: number, message?: string, options?: { cause?: unknown }) {\n    super(message || 'an error has occurred');\n    this.name = 'LiveKitError';\n    this.code = code;\n\n    if (typeof options?.cause !== 'undefined') {\n      this.cause = options?.cause;\n    }\n  }\n}\n\n/**\n * LiveKit specific error type representing an error with an associated set of reasons.\n * Use this to represent an error with multiple different but contextually related variants.\n * */\nexport abstract class LivekitReasonedError<Reason> extends LivekitError {\n  abstract reason: Reason;\n\n  abstract reasonName: string;\n}\n\nexport class SimulatedError extends LivekitError {\n  readonly name = 'simulated';\n\n  constructor(message = 'Simulated failure') {\n    super(-1, message);\n  }\n}\n\nexport enum ConnectionErrorReason {\n  NotAllowed,\n  ServerUnreachable,\n  InternalError,\n  Cancelled,\n  LeaveRequest,\n  Timeout,\n  WebSocket,\n  ServiceNotFound,\n}\n\ntype NotAllowed = {\n  reason: ConnectionErrorReason.NotAllowed;\n  status: number;\n  context?: unknown;\n};\n\ntype InternalError = {\n  reason: ConnectionErrorReason.InternalError;\n  status: never;\n  context?: { status?: number; statusText?: string };\n};\n\ntype ConnectionTimeout = {\n  reason: ConnectionErrorReason.Timeout;\n  status: never;\n  context: never;\n};\n\ntype LeaveRequest = {\n  reason: ConnectionErrorReason.LeaveRequest;\n  status: never;\n  context: DisconnectReason;\n};\n\ntype Cancelled = {\n  reason: ConnectionErrorReason.Cancelled;\n  status: never;\n  context: never;\n};\n\ntype ServerUnreachable = {\n  reason: ConnectionErrorReason.ServerUnreachable;\n  status?: number;\n  context?: never;\n};\n\ntype WebSocket = {\n  reason: ConnectionErrorReason.WebSocket;\n  status?: number;\n  context?: string;\n};\n\ntype ServiceNotFound = {\n  reason: ConnectionErrorReason.ServiceNotFound;\n  status: never;\n  context: string;\n};\n\ntype ConnectionErrorVariants =\n  | NotAllowed\n  | ConnectionTimeout\n  | LeaveRequest\n  | InternalError\n  | Cancelled\n  | ServerUnreachable\n  | WebSocket\n  | ServiceNotFound;\n\nexport class ConnectionError<\n  Variant extends ConnectionErrorVariants = ConnectionErrorVariants,\n> extends LivekitReasonedError<Variant['reason']> {\n  status?: Variant['status'];\n\n  context: Variant['context'];\n\n  reason: Variant['reason'];\n\n  reasonName: string;\n\n  readonly name = 'ConnectionError';\n\n  protected constructor(\n    message: string,\n    reason: Variant['reason'],\n    status?: Variant['status'],\n    context?: Variant['context'],\n  ) {\n    super(1, message);\n    this.status = status;\n    this.reason = reason;\n    this.context = context;\n    this.reasonName = ConnectionErrorReason[reason];\n  }\n\n  static notAllowed(message: string, status: number, context?: unknown) {\n    return new ConnectionError<NotAllowed>(\n      message,\n      ConnectionErrorReason.NotAllowed,\n      status,\n      context,\n    );\n  }\n\n  static timeout(message: string) {\n    return new ConnectionError<ConnectionTimeout>(message, ConnectionErrorReason.Timeout);\n  }\n\n  static leaveRequest(message: string, context: DisconnectReason) {\n    return new ConnectionError<LeaveRequest>(\n      message,\n      ConnectionErrorReason.LeaveRequest,\n      undefined,\n      context,\n    );\n  }\n\n  static internal(message: string, context?: { status?: number; statusText?: string }) {\n    return new ConnectionError<InternalError>(\n      message,\n      ConnectionErrorReason.InternalError,\n      undefined,\n      context,\n    );\n  }\n\n  static cancelled(message: string) {\n    return new ConnectionError<Cancelled>(message, ConnectionErrorReason.Cancelled);\n  }\n\n  static serverUnreachable(message: string, status?: number) {\n    return new ConnectionError<ServerUnreachable>(\n      message,\n      ConnectionErrorReason.ServerUnreachable,\n      status,\n    );\n  }\n\n  static websocket(message: string, status?: number, reason?: string) {\n    return new ConnectionError<WebSocket>(message, ConnectionErrorReason.WebSocket, status, reason);\n  }\n\n  static serviceNotFound(message: string, serviceName: 'v0-rtc') {\n    return new ConnectionError<ServiceNotFound>(\n      message,\n      ConnectionErrorReason.ServiceNotFound,\n      undefined,\n      serviceName,\n    );\n  }\n}\n\n/**\n * Whether a failed connection attempt may be retried against a different LiveKit Cloud region.\n *\n * LiveKit Cloud signals project-level region pinning by returning 403 on the RTC paths when the\n * project is not allowed in the region the client geo-routed to. `/settings/regions` is\n * deliberately left reachable so the client can discover its allowed regions and connect there, so\n * a 403 must not be treated as terminal.\n *\n * A 401 stays terminal: no other region will accept a token this one rejected. So does the 404\n * \"requested room does not exist\" case, which is also reported as `NotAllowed`.\n *\n * We key on the status rather than the server's error message because that message is an\n * unversioned human-readable string; matching it would let a copy edit break already-shipped\n * clients. If a 403 really was a permissions failure rather than region pinning, every region\n * attempt fails the same way and the original error still surfaces — at the cost of one extra\n * region lookup.\n */\nexport function canFailOverToAnotherRegion(error: ConnectionError): boolean {\n  if (error.reason === ConnectionErrorReason.Cancelled) {\n    return false;\n  }\n  if (error.reason === ConnectionErrorReason.NotAllowed) {\n    return error.status === 403;\n  }\n  return true;\n}\n\nexport class DeviceUnsupportedError extends LivekitError {\n  readonly name = 'DeviceUnsupportedError';\n\n  constructor(message?: string) {\n    super(21, message ?? 'device is unsupported');\n  }\n}\n\nexport class TrackInvalidError extends LivekitError {\n  readonly name = 'TrackInvalidError';\n\n  constructor(message?: string) {\n    super(20, message ?? 'track is invalid');\n  }\n}\n\nexport class UnsupportedServer extends LivekitError {\n  readonly name = 'UnsupportedServer';\n\n  constructor(message?: string) {\n    super(10, message || 'unsupported server');\n  }\n}\n\nexport class UnexpectedConnectionState extends LivekitError {\n  readonly name = 'UnexpectedConnectionState';\n\n  constructor(message?: string) {\n    super(12, message || 'unexpected connection state');\n  }\n}\n\nexport class NegotiationError extends LivekitError {\n  readonly name = 'NegotiationError';\n\n  constructor(message?: string) {\n    super(13, message || 'unable to negotiate');\n  }\n}\n\nexport class PublishDataError extends LivekitError {\n  readonly name = 'PublishDataError';\n\n  constructor(message?: string) {\n    super(14, message || 'unable to publish data');\n  }\n}\n\nexport class PublishTrackError extends LivekitError {\n  readonly name = 'PublishTrackError';\n\n  status: number;\n\n  constructor(message: string, status: number) {\n    super(15, message);\n    this.status = status;\n  }\n}\n\nexport type RequestErrorReason =\n  Exclude<RequestResponse_Reason, RequestResponse_Reason.OK> | 'TimeoutError';\n\nexport class SignalRequestError extends LivekitReasonedError<RequestErrorReason> {\n  readonly name = 'SignalRequestError';\n\n  reason: RequestErrorReason;\n\n  reasonName: string;\n\n  constructor(message: string, reason: RequestErrorReason) {\n    super(15, message);\n    this.reason = reason;\n    this.reasonName = typeof reason === 'string' ? reason : RequestResponse_Reason[reason];\n  }\n}\n\n// NOTE: matches with https://github.com/livekit/client-sdk-swift/blob/f37bbd260d61e165084962db822c79f995f1a113/Sources/LiveKit/DataStream/StreamError.swift#L17\nexport enum DataStreamErrorReason {\n  // Unable to open a stream with the same ID more than once.\n  AlreadyOpened = 0,\n\n  // Stream closed abnormally by remote participant.\n  AbnormalEnd = 1,\n\n  // Incoming chunk data could not be decoded.\n  DecodeFailed = 2,\n\n  // Read length exceeded total length specified in stream header.\n  LengthExceeded = 3,\n\n  // Read length less than total length specified in stream header.\n  Incomplete = 4,\n\n  // Unable to register a stream handler more than once.\n  HandlerAlreadyRegistered = 7,\n\n  // Encryption type mismatch.\n  EncryptionTypeMismatch = 8,\n\n  // The serialized stream header packet (driven mainly by attributes) exceeds the MTU budget.\n  HeaderTooLarge = 9,\n\n  // The stream's (decompressed) payload exceeds the maximum allowed size.\n  PayloadTooLarge = 10,\n}\n\nexport class DataStreamError extends LivekitReasonedError<DataStreamErrorReason> {\n  readonly name = 'DataStreamError';\n\n  reason: DataStreamErrorReason;\n\n  reasonName: string;\n\n  constructor(message: string, reason: DataStreamErrorReason) {\n    super(16, message);\n    this.reason = reason;\n    this.reasonName = DataStreamErrorReason[reason];\n  }\n}\n\nexport class SignalReconnectError extends LivekitError {\n  readonly name = 'SignalReconnectError';\n\n  constructor(message?: string) {\n    super(18, message);\n  }\n}\n\nexport enum MediaDeviceFailure {\n  // user rejected permissions\n  PermissionDenied = 'PermissionDenied',\n  // device is not available\n  NotFound = 'NotFound',\n  // device is in use. On Windows, only a single tab may get access to a device at a time.\n  DeviceInUse = 'DeviceInUse',\n  Other = 'Other',\n}\n\nexport namespace MediaDeviceFailure {\n  export function getFailure(error: any): MediaDeviceFailure | undefined {\n    if (error && 'name' in error) {\n      if (error.name === 'NotFoundError' || error.name === 'DevicesNotFoundError') {\n        return MediaDeviceFailure.NotFound;\n      }\n      if (error.name === 'NotAllowedError' || error.name === 'PermissionDeniedError') {\n        return MediaDeviceFailure.PermissionDenied;\n      }\n      if (error.name === 'NotReadableError' || error.name === 'TrackStartError') {\n        return MediaDeviceFailure.DeviceInUse;\n      }\n      return MediaDeviceFailure.Other;\n    }\n  }\n}\n"],"names":["LivekitError","Error","constructor","code","message","options","name","cause","LivekitReasonedError","SimulatedError","arguments","length","undefined","ConnectionErrorReason","ConnectionError","reason","status","context","reasonName","notAllowed","NotAllowed","timeout","Timeout","leaveRequest","LeaveRequest","internal","InternalError","cancelled","Cancelled","serverUnreachable","ServerUnreachable","websocket","WebSocket","serviceNotFound","serviceName","ServiceNotFound","canFailOverToAnotherRegion","error","DeviceUnsupportedError","TrackInvalidError","UnsupportedServer","UnexpectedConnectionState","NegotiationError","PublishDataError","PublishTrackError","SignalRequestError","RequestResponse_Reason","DataStreamErrorReason","DataStreamError","SignalReconnectError","MediaDeviceFailure","getFailure","NotFound","PermissionDenied","DeviceInUse","Other"],"mappings":"uDAEA;AACM,MAAOA,YAAa,SAAQC,KAAK,CAAA;AAMrCC,EAAAA,WAAAA,CAAYC,IAAY,EAAEC,OAAgB,EAAEC,OAA6B,EAAA;AACvE,IAAA,KAAK,CAACD,OAAO,IAAI,uBAAuB,CAAC;IACzC,IAAI,CAACE,IAAI,GAAG,cAAc;IAC1B,IAAI,CAACH,IAAI,GAAGA,IAAI;AAEhB,IAAA,IAAI,QAAOE,OAAO,KAAA,IAAA,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