Vapor Documentation Beta

Structure Error​Source

public struct ErrorSource

A source-code location.

Initializers

init(file:​function:​line:​column:​range:​)

public init(file: String, function: String, line: UInt, column: UInt, range: Range<UInt>? = nil)

Creates a new SourceLocation

Properties

file

var file: String

File in which this location exists.

function

var function: String

Function in which this location exists.

line

var line: UInt

Line number this location belongs to.

column

var column: UInt

Number of characters into the line this location starts at.

range

var range: Range<UInt>?

Optional start/end range of the source.

Methods

capture(file:​function:​line:​column:​range:​)

public static func capture(file: String = #file, function: String = #function, line: UInt = #line, column: UInt = #column, range: Range<UInt>? = nil) -> Self

Creates a new ErrorSource for the current call site.