     override func inputStremEvent(event: Stream.Event) {
         if event == .openCompleted {
             inputOpen = true
+        } else if event == .errorOccurred {
+            print("Stream open error")
+            self.error = input.streamError
         }
     }
     
     override func outputStremEvent(event: Stream.Event) {
         if event == .openCompleted {
             outOpen = true
+        } else if event == .errorOccurred {
+            print("Stream open error")
+            self.error = input.streamError
         }
     }
 }

class OpenOBDConnectionOperation: StreamHandleOperation {
    
    class func keyPathsForValuesAffectingIsFinished() -> Set<NSObject> {
        return ["inputOpen" as NSObject, "outOpen" as NSObject]
    }
    
    private var inputOpen = false {

        }
    }
    
    private var error:Error? {
        didSet {
            input.remove(from: .current, forMode: .defaultRunLoopMode)
            output.remove(from: .current, forMode: .defaultRunLoopMode)
        }
    }
    
    override var isExecuting: Bool {
        let value = !(inputOpen && outOpen) && error == nil
        print("isExecuting \(value)")
        return value
    }
    
    override var isFinished: Bool {
        let value = (inputOpen && outOpen) || error != nil
        print("isFinished \(value)")
        return value
    }
    
    override func main() {
