 
         let promise = Promise<Int>()
 
-        promise.reject(NSError(domain: "", code: -1, userInfo: nil))
+        promise.reject(self.generateRandomError())
 
         promise
             .then({ (value) -> Promise<Int> in

        expectations.append(self.expectationWithDescription("4"))

        // Promise and callback registration
        let promise = Promise<Int>()

        promise

        let expectation = self.expectationWithDescription("wait")

        let promise = Promise<Int>()
        let error   = self.generateRandomError()

        promise
            .then({ (value) in
