diff --git a/Sources/Foundation/NSError.swift b/Sources/Foundation/NSError.swift index af7fe0e54d..6f21d3a03d 100644 --- a/Sources/Foundation/NSError.swift +++ b/Sources/Foundation/NSError.swift @@ -182,7 +182,11 @@ open class NSError : NSObject, NSCopying, NSSecureCoding, NSCoding, @unchecked S } override open var description: String { - return "Error Domain=\(domain) Code=\(code) \"\(localizedFailureReason ?? "(null)")\"" + var result = "Error Domain=\(domain) Code=\(code) \"\(localizedFailureReason ?? "(null)")\"" + if !userInfo.isEmpty { + result += "UserInfo={\(userInfo.map { "\($0)=\($1)"}.joined(separator: ", "))}" + } + return result } // -- NSObject Overrides --