Skip to content

Commit

Permalink
Fix ErrorResponse description
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Dec 29, 2024
1 parent 18a0d37 commit ed26ea6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/AppleMapsKit/DTOs/ErrorResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@ public struct ErrorResponse: Error, Codable, Sendable {
}

extension ErrorResponse: CustomStringConvertible {
/// A textual representation of this error response.
public var description: String {
var result = #"AppleMapsError(message: \#(self.message ?? "nil")"#

if let details, !details.isEmpty {
result.append(", details: [")
result.append(details.joined(separator: ", "))

for (index, detail) in details.enumerated() {
result.append(#""\#(detail)""#)

if index < details.count - 1 {
result.append(", ")
}
}

result.append("]")
}

Expand Down

0 comments on commit ed26ea6

Please sign in to comment.