summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-02-08 13:39:11 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2025-02-08 13:39:11 +0100
commit75749328c72e92b0ab85a3dfd2092504751e40f6 (patch)
treeb4ef8fa56f9d8ab433a21e8fe123bcc4cfcd346b /lib/Travel
parentc75dbba5c88ee09d5f8183f7708547c4971bf8c7 (diff)
EFA->new_p: Return $self in rejected promise after successful request
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/EFA.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm
index b41e742..5d47565 100644
--- a/lib/Travel/Status/DE/EFA.pm
+++ b/lib/Travel/Status/DE/EFA.pm
@@ -45,7 +45,7 @@ sub new_p {
$self->check_for_ambiguous();
if ( $self->{errstr} ) {
- $promise->reject( $self->{errstr} );
+ $promise->reject( $self->{errstr}, $self );
return;
}
@@ -524,7 +524,7 @@ sub parse_line {
mot => $mode->{product},
operator => $mode->{diva}{operator},
identifier => $mode->{diva}{globalId},
- ,
+
);
}
@@ -771,8 +771,14 @@ Default: 10 seconds. Set to 0 or a negative value to disable it.
=item my $status_p = Travel::Status::DE::EFA->new_p(I<%opt>)
Returns a promise that resolves into a Travel::Status::DE::EFA instance
-($status) on success and rejects with an error message on failure. In addition
-to the arguments of B<new>, the following mandatory arguments must be set.
+($status) on success and rejects with an error message on failure. In case
+the error occured after construction of the Travel::Status::DE::EFA object
+(e.g. due to an ambiguous name/place parameter), the second argument of the
+rejected promise holds a Travel::Status::DE::EFA instance that can be used
+to query place/name candidates (see name_candidates and place_candidates).
+
+In addition to the arguments of B<new>, the following mandatory arguments must
+be set.
=over