Skip to content

Commit

Permalink
Promote Error to LocalizedError
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLeif committed Feb 17, 2023
1 parent b69f458 commit 12257de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/t/t.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import Foundation

/// A simple way to test expectations using functions and errors
public enum t {
/// Simple Error with a description stating the failure
public struct TestError: Error {
public struct TestError: LocalizedError {
public let description: String
public let lineNumber: Int
public let functionName: String
public let fileName: String

public var errorDescription: String? {
"\(description) (file: \(fileName) func: \(functionName)@\(lineNumber))"
}
}
}

0 comments on commit 12257de

Please sign in to comment.