summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/Travelynx/Controller/Traveling.pm9
-rw-r--r--templates/bad_gateway.html.ep21
2 files changed, 29 insertions, 1 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm
index bbd85b6..0a94a1e 100755
--- a/lib/Travelynx/Controller/Traveling.pm
+++ b/lib/Travelynx/Controller/Traveling.pm
@@ -1129,11 +1129,18 @@ sub station {
}
)->wait;
}
+ elsif ( $err =~ m{svcRes} ) {
+ $self->render(
+ 'bad_gateway',
+ message => $err,
+ status => 502
+ );
+ }
else {
$self->render(
'exception',
exception => $err,
- status => 502
+ status => 500
);
}
}
diff --git a/templates/bad_gateway.html.ep b/templates/bad_gateway.html.ep
new file mode 100644
index 0000000..773cda8
--- /dev/null
+++ b/templates/bad_gateway.html.ep
@@ -0,0 +1,21 @@
+<div class="row">
+ <div class="col s12">
+ <div class="card caution-color">
+ <div class="card-content white-text">
+ <span class="card-title">502 Bad Gateway</span>
+ <p>
+ Das von travelynx genutzte Backend hat einen Fehler zurückgegeben.
+ Oft sind diese temporär – versuche es in ein paar Sekunden bis Minuten noch einmal.
+ </p>
+ </div>
+ </div>
+ </div>
+</div>
+<div class="row">
+ <div class="col s12">
+ <p>Details:</p>
+ <p style="font-family: monospace;">
+ %= $message
+ </p>
+ </div>
+</div>