summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-08-20 17:38:24 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-08-20 17:38:24 +0200
commitd57e93819d6c6d3adafe6271d87f7dd527971c7d (patch)
tree1879c021564b97388702dbca4788344da875f219
parent46092e321dd4059f6e8361ff38be658fac765b48 (diff)
new_p: add $self to reject arguments when sensible
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm
index 6abf764..41230ea 100644
--- a/lib/Travel/Status/DE/HAFAS.pm
+++ b/lib/Travel/Status/DE/HAFAS.pm
@@ -442,7 +442,7 @@ sub new_p {
$self->parse_board;
}
if ( $self->errstr ) {
- $promise->reject( $self->errstr );
+ $promise->reject( $self->errstr, $self );
}
else {
$promise->resolve($self);
@@ -1016,8 +1016,10 @@ Request a polyline (series of geo-coordinates) indicating the train's route.
=item my $status_p = Travel::Status::DE::HAFAS->new_p(I<%opt>)
Return a promise that resolves into a Travel::Status::DE::HAFAS instance
-($status) on success and rejects with an error message ($status->errstr) on
-failure. In addition to the arguments of B<new>, the following mandatory
+($status) on success and rejects with an error message and optional HAFAS
+instance ($status->errstr[, $status]) on failure. The optional HAFAS instance
+is only present if the error occured late, e.g. due to an ambiguous location
+specifier. In addition to the arguments of B<new>, the following mandatory
arguments must be set.
=over