             expectations[i++].fulfill()
         })
 
-        promise.reject(NSError(domain: "", code: -1, userInfo: nil))
+        promise.reject(error)
 
         promise.then(serialQueue, nil, { (e: NSError) -> Void in
             XCTAssertEqual(i, 2)


    func testPropagateNSErrorInCallbackReturnsPromise() {
        let expectation = self.expectationWithDescription("wait")
        let promise = Promise<Int>()

        promise
            .then({ (i) throws -> Promise<Int> in
                throw NSError(domain: "test.SomeError", code: 123, userInfo: nil)
            })
            .then(nil, { (e: NSError) in
                XCTAssertEqual(e.domain, "test.SomeError")
                XCTAssertEqual(e.code, 123)
                expectation.fulfill()
            })



        let promise = Promise<Int>()

        promise.reject(self.generateRandomError())

        promise
            .then({ (value) -> Promise<Int> in
