Skip Menu |

This queue is for tickets about the Promises CPAN distribution.

Report information
The Basics
Id: 81358
Status: resolved
Priority: 0/
Queue: Promises

People
Owner: Nobody in particular
Requestors: TOSHIOITO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Results in rejected Promise returned from then() handler are not given to the next then() handler
In short, isn't the test below supposed to pass? It seems that the results of the Promise returned from the first then() handler are not given to the error handler in the next then(). use warnings; use Promises; use Test::More tests => 2; Promises::Deferred->new->resolve("foo")->then(sub { my $result = shift; is($result, "foo", "resolved. foo."); return Promises::Deferred->new->reject("bar")->promise; }, sub { @_ })->then(sub { @_ }, sub { my $result = shift; is($result, "bar", "rejected. bar."); #### failure });
This test has been added (https://github.com/stevan/promises-perl/blob/master/t/021- chaining-errors.t) and the error fixed. Thanks for submitting this. The code is currently on github (https://github.com/stevan/promises-perl) but will be released to CPAN as 0.02 shortly.
sorry, forgot to resolve