diff client/src/components/map/layers.js @ 4867:5555b77b8c4e

report backenderror due to failing OL loaders
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 17 Dec 2019 14:27:44 +0100
parents 75d1126f7299
children c4d84be3a476
line wrap: on
line diff
--- a/client/src/components/map/layers.js	Fri Dec 13 12:39:08 2019 +0100
+++ b/client/src/components/map/layers.js	Tue Dec 17 14:27:44 2019 +0100
@@ -58,6 +58,7 @@
       })
       .catch(() => {
         vectorSource.removeLoadedExtent(extent);
+        store.dispatch("application/reportBackendError");
       });
   };
 };
@@ -352,9 +353,13 @@
                   "X-Gemma-Auth": localStorage.getItem("token")
                 },
                 responseType: "blob"
-              }).then(response => {
-                tile.getImage().src = URL.createObjectURL(response.data);
-              });
+              })
+                .then(response => {
+                  tile.getImage().src = URL.createObjectURL(response.data);
+                })
+                .catch(() => {
+                  store.dispatch("application/reportBackendError");
+                });
             } // TODO  tile.setState(TileState.ERROR);
           })
         }),
@@ -378,9 +383,13 @@
                   "X-Gemma-Auth": localStorage.getItem("token")
                 },
                 responseType: "blob"
-              }).then(response => {
-                tile.getImage().src = URL.createObjectURL(response.data);
-              });
+              })
+                .then(response => {
+                  tile.getImage().src = URL.createObjectURL(response.data);
+                })
+                .catch(() => {
+                  store.dispatch("application/reportBackendError");
+                });
             } // TODO  tile.setState(TileState.ERROR);
           })
         }),
@@ -474,9 +483,13 @@
                   "X-Gemma-Auth": localStorage.getItem("token")
                 },
                 responseType: "blob"
-              }).then(response => {
-                tile.getImage().src = URL.createObjectURL(response.data);
-              });
+              })
+                .then(response => {
+                  tile.getImage().src = URL.createObjectURL(response.data);
+                })
+                .catch(() => {
+                  store.dispatch("application/reportBackendError");
+                });
             } // TODO  tile.setState(TileState.ERROR);
           })
         }),
@@ -601,9 +614,13 @@
                   "X-Gemma-Auth": localStorage.getItem("token")
                 },
                 responseType: "blob"
-              }).then(response => {
-                tile.getImage().src = URL.createObjectURL(response.data);
-              });
+              })
+                .then(response => {
+                  tile.getImage().src = URL.createObjectURL(response.data);
+                })
+                .catch(() => {
+                  store.dispatch("application/reportBackendError");
+                });
             } // TODO  tile.setState(TileState.ERROR);
           })
         }),