Functions
The following functions are available globally.
-
Unwraps the given optional, and throws an exception if the optional is nil.
Declaration
Swift
public func unwrap<T>(_ optional: T?) throws -> T -
Compares two error objects. Allows the comparison of different Error enums or an Error protocol and a specific Error enum.
This is useful when catching exceptions of a specific Exception subclass and a specific underlying Error.
catch let error as Exception where error.error == ValueError.invalidArgumentDeclaration
Swift
public func == <T>(lhs: Error, rhs: T) -> Bool where T : Equatable, T : ErrorParameters
lhsAn error to compare with.
rhsAn error to compare to. Must be equatable.
Return Value
trueif the errors are equal,falseotherwise.
Functions Reference