MediaPipeTasksCommon Framework Reference

TasksErrorCode

enum TasksErrorCode: Sendable, Equatable, Hashable, CaseIterable, RawRepresentable

Error codes thrown by the MediaPipe Tasks library.

  • Indicates the operation was aborted, typically due to a concurrency or transaction failure.

    Declaration

    Swift

    case aborted
  • Indicates that the entity a caller attempted to create is already present.

    Declaration

    Swift

    case alreadyExists
  • Indicates that AudioRecord is not tapping the microphone.

    Declaration

    Swift

    case audioRecordNotTappingMic
  • Indicates that audio record permissions were denied by the user.

    Declaration

    Swift

    case audioRecordPermissionDenied
  • Indicates that audio record permissions cannot be determined.

    Declaration

    Swift

    case audioRecordPermissionUndetermined
  • Indicates that AudioRecord is waiting for new microphone input.

    Declaration

    Swift

    case audioRecordWaitingForNewMicInput
  • Indicates the operation was cancelled, typically by the caller.

    Declaration

    Swift

    case cancelled
  • Indicates that unrecoverable data loss or corruption has occurred.

    Declaration

    Swift

    case dataLoss
  • Indicates a deadline expired before the operation could complete.

    Declaration

    Swift

    case deadlineExceeded
  • Indicates that the operation was rejected because the system is not in a required state.

    Declaration

    Swift

    case failedPrecondition
  • Indicates an internal error has occurred and underlying system invariants were violated.

    Declaration

    Swift

    case internalError
  • Indicates the caller specified an invalid argument, such as a malformed filename.

    Declaration

    Swift

    case invalidArgument
  • Indicates some requested entity (such as a file or directory) was not found.

    Declaration

    Swift

    case notFound
  • Indicates the operation was attempted past the valid range.

    Declaration

    Swift

    case outOfRange
  • Indicates that the caller does not have permission to execute the specified operation.

    Declaration

    Swift

    case permissionDenied
  • Indicates some resource has been exhausted, such as a per-user quota or disk space.

    Declaration

    Swift

    case resourceExhausted
  • Indicates that the request does not have valid authentication credentials.

    Declaration

    Swift

    case unauthenticated
  • Indicates the service is currently unavailable, typically as a transient condition.

    Declaration

    Swift

    case unavailable
  • Indicates the operation is not implemented or supported.

    Declaration

    Swift

    case unimplemented
  • Indicates an unknown error occurred.

    Declaration

    Swift

    case unknown
  • A collection of all values of this type.

    Declaration

    Swift

    nonisolated static var allCases: [TasksErrorCode] { get }
  • Creates a new instance with the specified raw value.

    If there is no value of the type that corresponds with the specified raw value, this initializer returns nil. For example:

    enum PaperSize: String { case A4, A5, Letter, Legal }

    print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)"

    print(PaperSize(rawValue: "Tabloid")) // Prints "nil"

    Declaration

    Swift

    init?(rawValue: Int)

    Parameters

    rawValue

    The raw value to use for the new instance.

  • Fallback human-readable description when an explicit error message is unavailable.

    Declaration

    Swift

    var defaultDescription: String { get }
  • The corresponding value of the raw type.

    A new instance initialized with rawValue will be equivalent to this instance. For example:

    enum PaperSize: String { case A4, A5, Letter, Legal }

    let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter"

    print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"

    Declaration

    Swift

    var rawValue: Int { get }
  • A type that can represent a collection of all values of this type.

    Declaration

    Swift

    typealias AllCases = [TasksErrorCode]