ValueException
open class ValueException<T> : Exception
An exception caused by an incorrect value.
-
The value that caused the exception.
Declaration
Swift
public let actualValue: T -
Initializes an Exception instance.
Declaration
Swift
public init(error:Error, message:String?, actualValue:T, stackTrace:[String]? = nil)Parameters
errorThe error causing the exception.
messageA human-readable message explaining the error.
actualValueThe (incorrect) value causing the exception.
stackTraceThe stack trace at the time the exception was thrown. Defaults to
Thread.callStackSymbols. -
Constructs a ValueException with a message displaying expected value.
Declaration
Swift
public static func expected(value: T, error: Error, actualValue: T) -> ValueException<T>Parameters
valueThe expected value.
errorThe error the exception represents.
actualValueThe actual value causing the error. Must not be value.
Return Value
A ValueException
instance. -
Declaration
Swift
open override func descriptionComponents() -> [String]
ValueException Class Reference