         self.otherInfo = nil
     }
 
-    public init(source: String, operation: String, error: NSError) {
+    public init(source: String, operation: String, error: Error) {
         self.source = source
         self.operation = operation
         self.otherInfo = nil
-        if error.domain == "NSURLErrorDomain" {
+        if let error = error as? NSError, error.domain == "NSURLErrorDomain" {
             switch error.code {
             case -1009:
                 self.reason = .noInternet

    }

    #if os(iOS)
    public init?(source: String, operation: String, response: HTTPURLResponse?, data: Data?) {
        self.source = source
        self.operation = operation
        if let response = response {

            encoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding(encodingName as CFString!)))
        }
        else {
            encoding = .utf8
        }
        if let json = try? JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions())
            , let dict = json as? [String:String]
