From f462b95adf2c18c9a734187b58281da258439db4 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 13 Aug 2024 20:48:11 +0200 Subject: wagonorder: always reject promise with plain-text strings --- lib/DBInfoscreen/Helper/Wagonorder.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/DBInfoscreen/Helper/Wagonorder.pm b/lib/DBInfoscreen/Helper/Wagonorder.pm index 5b69da9..eb5cd74 100644 --- a/lib/DBInfoscreen/Helper/Wagonorder.pm +++ b/lib/DBInfoscreen/Helper/Wagonorder.pm @@ -56,7 +56,9 @@ sub get_p { if ( my $content = $cache->thaw($url) ) { $self->{log}->debug("wagonorder->get_p($url): cached"); if ( $content->{error} ) { - return $promise->reject($content); + return $promise->reject( +"GET $url: HTTP $content->{error}{code} $content->{error}{message} (cachd)" + ); } return $promise->resolve( $content, \%param ); } @@ -77,7 +79,7 @@ sub get_p { "wagonorder->get_p($url): HTTP $err->{code} $err->{message}" ); $cache->freeze( $url, $json ); - $promise->reject($json); + $promise->reject("GET $url: HTTP $err->{code} $err->{message}"); return; } -- cgit v1.2.3