From 83f54386b7877ec66c70b79962d3cd73a17ac8a5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 15 Jul 2021 20:34:00 +0200 Subject: add error handling for hafas and efa requests --- static/v0/js/geolocation.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'static/v0/js') diff --git a/static/v0/js/geolocation.js b/static/v0/js/geolocation.js index 1ea4ee5..4f520b9 100644 --- a/static/v0/js/geolocation.js +++ b/static/v0/js/geolocation.js @@ -11,6 +11,12 @@ document.addEventListener("DOMContentLoaded", function() { const processResult = function(results) { const list = document.createElement("ul"); list.className = "stops"; + + if (results.error) { + showError("Backend-Fehler:", results.msg); + return; + } + for (var result in results) { result = results[result]; const listentry = document.createElement("li"); -- cgit v1.2.3