     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
         }
     }
 }

        }
    }
    
    override var isFinished: Bool {
        return inputOpen && outOpen
    }
    
    override func main() {

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