summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-11-20 13:02:44 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-11-20 13:02:44 +0100
commit3fac36617f9b0f125ce477808873e2e34f4c9cdd (patch)
tree38f675b63e9cc4d021c3e4543ff1c5b981b1ca0a /cgi
parentff4e248c6baf0468ff9dbe6b99d4c59191a67277 (diff)
detect Travel::Status::DE::VRR error messages
Diffstat (limited to 'cgi')
-rw-r--r--cgi/index.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index e9fff98..04bbb7d 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -109,6 +109,10 @@ sub render_image {
my ( $results, $errstr ) = get_results_for( $city, $stop );
+ if ($errstr) {
+ $color = '255,0,0';
+ }
+
my $strp_simple = DateTime::Format::Strptime->new(
pattern => '%H:%M',
time_zone => 'floating',
@@ -139,6 +143,13 @@ sub render_image {
color => [ split( qr{,}, $color ) ]
);
+ if ($errstr) {
+ $png->draw_at(6, '-------efa.vrr.de error-------');
+ $png->new_line();
+ $png->new_line();
+ $png->draw_at(0, $errstr);
+ }
+
$self->res->headers->content_type('image/png');
for my $d ( @{$results} ) {