     }
 
     func resolve(result: Any?) {
-        complete(result: result, errorContainer: nil)
+        complete(result: result, error: nil)
     }
     
-    func reject(error: Any?) {
-        complete(result: nil, errorContainer: ErrorContainer(value: error))
+    func reject(error: HNTaskError?) {
+        complete(result: nil, error: error)
     }
     
     // @private
-    func complete(#result: Any?, errorContainer: ErrorContainer?) {
+    func complete(#result: Any?, error: HNTaskError?) {
         doInLock { () -> Void in
             if !self._completed {
                 self._completed = true
                 self._result = result
-                self._errorContainer = errorContainer
+                self._error = error
             }
             
             // TODO: notify


// suppose it is used in this way

//func foo() {
//    let task = HNTask()
//    task.resolve(nil)

                if let resultTask = result as? HNTask {
                    resultTask.continueWith { context in
                        // TODO: cancel?
                        task.complete(result: context.result, error: context.error)
                        return nil
                    }
                } else {
                    task.complete(result: result, error: self.error)
                }
            }
        }
