Vapor Documentation Beta

Protocol Debuggable​Error

public protocol DebuggableError: LocalizedError, CustomDebugStringConvertible, CustomStringConvertible

Debuggable provides an interface that allows a type to be more easily debugged in the case of an error.

%3 DebuggableError DebuggableError LocalizedError LocalizedError DebuggableError->LocalizedError CustomStringConvertible CustomStringConvertible DebuggableError->CustomStringConvertible CustomDebugStringConvertible CustomDebugStringConvertible DebuggableError->CustomDebugStringConvertible Abort Abort Abort->DebuggableError

Conforms To

CustomDebugStringConvertible
CustomStringConvertible
LocalizedError

Types Conforming to Debuggable​Error

Abort

Default implementation of AbortError. You can use this as a convenient method for throwing AbortErrors without having to conform your own error-type to AbortError.

Requirements

readable​Name

var readableName: String

A readable name for the error's Type. This is usually similar to the Type name of the error with spaces added. This will normally be printed proceeding the error's reason.

type​Identifier

var typeIdentifier: String

A unique identifier for the error's Type.

identifier

var identifier: String

Some unique identifier for this specific error. This will be used to create the identifier property. Do NOT use String(reflecting: self) or String(describing: self) or there will be infinite recursion

reason

var reason: String

The reason for the error. Usually one sentence (that should end with a period).

source

var source: ErrorSource?

Optional source for this error

stack​Trace

var stackTrace: StackTrace?

Stack trace from which this error originated (must set this from the error's init)

possible​Causes

var possibleCauses: [String]

A String array describing the possible causes of the error.

suggested​Fixes

var suggestedFixes: [String]

A String array listing some common fixes for the error.

stack​Overflow​Questions

var stackOverflowQuestions: [String]

An array of string URLs linking to related Stack Overflow questions.

git​Hub​Issues

var gitHubIssues: [String]

An array of string URLs linking to related issues on Vapor's GitHub repo.

log​Level

var logLevel: Logger.Level

Which log level this error should report as. Defaults to .error.