CausalErrorType
public protocol CausalErrorType : CustomDebugStringConvertible, CustomStringConvertible, Error
An error type that captures not just a current error, but the hierarchy of errors that caused it.
-
Any errors which can be rolled up into this error
Declaration
Swift
var causedBy: [Error]? { get }
-
The range of the error in the source
String
Declaration
Swift
var range: ClosedRange<String.Index>? { get }
-
The message associated with the error
Declaration
Swift
var message: String { get }
-
The error should stop subsequent processing
Declaration
Swift
var isFatal: Bool { get }
-
description
Extension methodA textural description of the error
Declaration
Swift
var description: String { get }
-
debugDescription
Extension methodA more detailed description of the error including the hierarchy of errors that built to this error
Declaration
Swift
var debugDescription: String { get }
-
hasCause(description:)
Extension methodReturns true if the supplied error includes the supplied description in its description
Declaration
Swift
public func hasCause(description: String) -> Bool
Parameters
description
The text being searched for
Return Value
True if it contains the message, false if not
-
formattedErrorMessage(in:)
Extension methodProvides a formatted version of the error message suitable for printing in a fixed width font, with a pointer highlighting the location of the error
Declaration
Swift
func formattedErrorMessage(in input: String) -> String
Parameters
in
The original source that was being parsed
Return Value
A formatted
String
with a human readable and helpful message