     private var state: State<T> = .pending(Handlers<T>())
     private var queue = DispatchQueue(label: "com.github.kean.Promise")
     
-    public init(_ closure: @noescape (fulfill: (value: T) -> Void, reject: (error: ErrorProtocol) -> Void) -> Void) {
+    public init(_ closure: @noescape (fulfill: (value: T) -> Void, reject: (error: Error) -> Void) -> Void) {
         closure(fulfill: { self.resolve(resolution: .fulfilled($0)) },
                 reject: { self.resolve(resolution: .rejected($0)) })
     }

        }
    }
    
    public func then(fulfilment: ((value: T) -> Void)?, rejection: ((error: ErrorProtocol) -> Void)?) -> Promise {
        completion { resolution in
            switch resolution {
            case let .fulfilled(val): fulfilment?(value: val)

}

public enum Resolution<T> {
    case fulfilled(T), rejected(Error)
}
