From d53c7f3a3596d2e2eb4ff5c290019ee536b48aa1 Mon Sep 17 00:00:00 2001 From: Henrik Panhans Date: Fri, 10 Apr 2020 03:05:07 +0200 Subject: [PATCH] Now feeding raw json --- Sources/HPNetwork/NSError+Extensions.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Sources/HPNetwork/NSError+Extensions.swift b/Sources/HPNetwork/NSError+Extensions.swift index 0b0e6b8..e25450f 100644 --- a/Sources/HPNetwork/NSError+Extensions.swift +++ b/Sources/HPNetwork/NSError+Extensions.swift @@ -11,11 +11,7 @@ extension NSError { } func injectJSON(_ data: Data) -> NSError { - guard let jsonData = try? JSONSerialization.data(withJSONObject: data, options: .prettyPrinted) else { - return self - } - - let jsonString = String(data: jsonData, encoding: .utf8) + let jsonString = String(data: data, encoding: .utf8) var dict = userInfo dict[NSError.hpCodableDataKey] = jsonString