We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c110bd1 commit 5446eabCopy full SHA for 5446eab
Sources/TSCBasic/JSON.swift
@@ -171,7 +171,7 @@ import Foundation
171
172
enum JSONDecodingError: Error {
173
/// The input byte string is malformed.
174
- case malformed
+ case malformed(json: String, underlyingError: Error)
175
}
176
177
extension JSONDecodingError: CustomNSError {
@@ -262,7 +262,7 @@ extension JSON {
262
// times.
263
self = JSON.convertToJSON(result)
264
} catch {
265
- throw JSONDecodingError.malformed
+ throw JSONDecodingError.malformed(json: String(data: data, encoding: .utf8) ?? data.description, underlyingError: error)
266
267
268
0 commit comments