CError

public struct CError: Swift.Error

CError is an error thrown by a C system call. It may be from a typical -1 return code that sets errno, from a getaddrinfo call or directly from an errno.

  • The error code.

    Declaration

    Swift

    public let code: Int32
  • The error message as returned by strerror or gai_strerror.

    Declaration

    Swift

    public let message: String
  • Creates and throws the corresponding CError if the code is equal to errorValue, otherwise is a no-op.

    Declaration

    Swift

    public static func makeAndThrow(fromReturnCode code: Int32, errorValue: Int32 = -1) throws
  • Creates and throws the corresponding CError if errno is not equal to 0, otherwise is a no-op.

    Declaration

    Swift

    public static func makeAndThrow(fromErrNo errno: Int32) throws
  • Creates and throws the corresponding CError if code is not equal to 0, otherwise is a no-op.

    Declaration

    Swift

    public static func makeAndThrow(fromGAICode code: Int32) throws
  • The string description of the error.

    Declaration

    Swift

    public var description: String