FdbApiError

public struct FdbApiError : Error

This type wraps an error thrown by the FoundationDB C API.

  • The error code from the API.

    Declaration

    Swift

    public let errorCode: Int32
  • The description of the error code.

    Declaration

    Swift

    public let description: String
  • This initializer creates an API Error.

    Declaration

    Swift

    public init(_ errorCode: Int32)

    Parameters

    errorCode

    The error code from the API.

  • This method wraps around a block that calls an API function that can return an error.

    If the API function returns an error, this will wrap it in this type and throw the error.

    Throws

    The error from the block.

    Declaration

    Swift

    public static func wrapApiError(_ block: @autoclosure () -> fdb_error_t) throws -> Void

    Parameters

    block

    The block that can return the error.