diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-12-04 17:43:47 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-12-04 17:43:47 +0100 |
commit | 158ccca896754ce1dbb7885aba3212a852a7bed9 (patch) | |
tree | d85ce23370c7c95894c30f45f5a0d3031a11b84c | |
parent | 5f8cc31238bcc77aad019a751e70e92ede9fead1 (diff) |
Add a separate error message for gateway timeouts
-rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 7 | ||||
-rw-r--r-- | templates/gateway_timeout.html.ep | 22 |
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 0a94a1e..101ae11 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -1136,6 +1136,13 @@ sub station { status => 502 ); } + elsif ( $err =~ m{timeout}i ) { + $self->render( + 'gateway_timeout', + message => $err, + status => 504 + ); + } else { $self->render( 'exception', diff --git a/templates/gateway_timeout.html.ep b/templates/gateway_timeout.html.ep new file mode 100644 index 0000000..86e844d --- /dev/null +++ b/templates/gateway_timeout.html.ep @@ -0,0 +1,22 @@ +<div class="row"> + <div class="col s12"> + <div class="card caution-color"> + <div class="card-content white-text"> + <span class="card-title">504 Gateway Timeout</span> + <p> + Das von travelynx genutzte Backend hat nicht rechtzeitig reagiert. + travelynx hat keine Möglichkeiten, diese Situation zu beheben. + Vrsuche 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> |