Skip to content

Commit cab96f6

Browse files
Fix json parsing error message formatting (#398)
1 parent 3b9d232 commit cab96f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/TSCUtility/JSONMessageStreamingParser.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ private extension JSONMessageStreamingParser {
168168
do {
169169
return try decoder.decode(Message.self, from: data)
170170
} catch {
171-
throw ParsingError(reason: "unexpected JSON message: \(ByteString(buffer).cString)", underlyingError: error)
171+
let message = ByteString(Array(data)).cString
172+
throw ParsingError(reason: "unexpected JSON message: \(message)", underlyingError: error)
172173
}
173174
}
174175
}

0 commit comments

Comments
 (0)