aboutsummaryrefslogtreecommitdiff
path: root/static/user/user-additions.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/user/user-additions.js')
-rw-r--r--static/user/user-additions.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/static/user/user-additions.js b/static/user/user-additions.js
index 0de825e8..c0579df5 100644
--- a/static/user/user-additions.js
+++ b/static/user/user-additions.js
@@ -34,8 +34,10 @@ window.formatters.set('description', (el, d) => {
window.salar = new Promise((resolve, reject) =>
fetch('/static/user/salar.json')
- .then(d => d.json())
- .then(d => resolve(d)))
+ .then(resp => { if (! resp.ok) reject("404"); else resp.json() })
+ .then(d => resolve(d))
+ .catch(err => reject(err))
+)
window.formatters.set('location', async function(el, d) {
@@ -46,7 +48,12 @@ window.formatters.set('location', async function(el, d) {
return;
}
- let salar = await window.salar;
+ try {
+ let salar = await window.salar;
+ } catch (e) {
+ console.warn("Location formatter failed", e);
+ return;
+ }
let name = m[1]
let frag = salar[name];