Unverified Commit dd1b29bc authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

/z/:train/*station: fix 404 respons for JSON requests

parent f51b692a
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -1098,11 +1098,20 @@ sub station_train_details {
	)->catch(
		sub {
			my ($errstr) = @_;
			$self->render(
				'landingpage',
			$self->respond_to(
				json => {
					json => {
						error =>
"Keine Abfahrt von $train_no in $station gefunden: $errstr",
					},
					status => 404,
				},
				any => {
					template => 'landingpage',
					error    =>
"Keine Abfahrt von $train_no in $station gefunden: $errstr",
					status => 404,
				},
			);
			return;
		}