         }
     }
     
-    func close0(promise: Promise<Void> = Promise<Void>(), error: Error = IOError(errno: EBADF, reason: "Channel closed")) {
+    func close0(promise: Promise<Void> = Promise<Void>(), error: Error = ChannelError.closed) {
         guard open else {            
 
             // Already closed

    }
    
    override fileprivate func writeToSocket(pendingWrites: PendingWrites) throws -> Bool? {
        pendingWrites.failAll(error: MessageError.unsupported)
        return true
    }
    

    }
}

public enum ChannelError: Error {
    case messageUnsupported
    case closed
}
