LeafError (ext)
You’re viewing third-party extensions to LeafError
, a struct from leaf-kit.
You can also read the documentation forLeafError
itself.
extension LeafError
You’re viewing third-party extensions to LeafError
, a struct from leaf-kit.
You can also read the documentation forLeafError
itself.
extension LeafError
struct LeafError
LeafError
reports errors during the template rendering process, wrapping more specific errors if necessary during Lexing and Parsing stages.
import Leaf
Leaf provides integrations between LeafKit and Vapor to make it easy to use Leaf templates in your Vapor app. It provides extensions to make it easy to set up, configure and use Leaf as your renderer in Vapor. It also conforms LeafRenderer
to ViewRenderer
so it can be used to render generic Views in Vapor.
protocol AbortError : Error
Errors conforming to this protocol will always be displayed by Vapor to the end-user (even in production mode where most errors are silenced).
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol DebuggableError : LocalizedError, CustomDebugStringConvertible, CustomStringConvertible
Debuggable
provides an interface that allows a type to be more easily debugged in the case of an error.
protocol Escapable
protocol LocalizedError : Error
Describes an error that provides localized messages describing why an error occurred and provides more information about the error.
var abortReason: String { get }
The use of @_implements
here allows us to get away with the fact that AbortError
requires a property named reason
of type String
while LeafError
has an identically named property of an enum type.
var debuggableReason: String { get }
Again, the udnerscored attribute gets around the inconvenient naming collision.
var source: ErrorSource? { get }
See Vapor/DebuggableError/source
.
var status: HTTPResponseStatus { get }
See status
.
static var readableName: String { get }
static var typeIdentifier: String { get }
var debugDescription: String { get }
See CustomDebugStringConvertible
var description: String { get }
See CustomStringConvertible
var documentationLinks: [String] { get }
var errorDescription: String? { get }
A localized message describing what error occurred.
var failureReason: String? { get }
A localized message describing the reason for the failure.
var fullIdentifier: String { get }
var gitHubIssues: [String] { get }
var headers: HTTPHeaders { get }
See AbortError
.
var helpAnchor: String? { get }
A localized message providing “help” text if the user requests help.
var identifier: String { get }
See DebuggableError
.
var logLevel: Logger.Level { get }
var possibleCauses: [String] { get }
var reason: String { get }
See AbortError
.
var recoverySuggestion: String? { get }
A localized message describing how one might recover from the failure.
var stackOverflowQuestions: [String] { get }
var suggestedFixes: [String] { get }
func debuggableHelp(format: HelpFormat) -> String
A computed property returning a String
that encapsulates why the error occurred, suggestions on how to fix the problem, and resources to consult in debugging (if these are available).
var stackTrace: StackTrace? { get }