Skip to content

Commit

Permalink
Make DotEnvironment.Failure CustomStringConvertible
Browse files Browse the repository at this point in the history
  • Loading branch information
juri committed May 11, 2024
1 parent a4b87ff commit 945f9bc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/DotEnvy/Load.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,14 @@ extension DotEnvironment {
case parseError(ParseErrorWithLocation, String)
}
}

extension DotEnvironment.Failure: CustomStringConvertible {
public var description: String {
switch self {
case let .dataDecodingError(url):
"Error decoding data at \(url)"
case let .parseError(parseErrorWithLocation, source):
parseErrorWithLocation.formatError(source: source)
}
}
}

0 comments on commit 945f9bc

Please sign in to comment.