Try/catch around notification - failure should not abort processing!

This commit is contained in:
Simon Brooke 2020-02-25 21:53:05 +00:00
parent 80e5198b32
commit 3a34ba7adf
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987
3 changed files with 31 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
img/map-pins/colours/*.png img/map-pins/colours/*.png
img/map-pins/colours/*.svg img/map-pins/colours/*.svg
node_modules

View file

@ -266,7 +266,12 @@ var GeoCSV = {
*/ */
error( m) { error( m) {
console.error( m); console.error( m);
document.getElementById( "error").innerText = m; try {
document.getElementById( "error").innerText = m;
}
catch (anything) {
console.warn( "Error while trying to warn user: ", anything);
}
}, },
/** /**
@ -274,7 +279,12 @@ var GeoCSV = {
*/ */
message( m) { message( m) {
console.log( m); console.log( m);
document.getElementById( "message").innerText = m; try {
document.getElementById( "message").innerText = m;
}
catch (anything) {
console.warn( "Error while trying to notify user: ", anything);
}
} }
}, },

18
package-lock.json generated Normal file
View file

@ -0,0 +1,18 @@
{
"name": "geocsv",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"leaflet": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.6.0.tgz",
"integrity": "sha512-CPkhyqWUKZKFJ6K8umN5/D2wrJ2+/8UIpXppY7QDnUZW5bZL5+SEI2J7GBpwh4LIupOKqbNSQXgqmrEJopHVNQ=="
},
"papaparse": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.1.1.tgz",
"integrity": "sha512-KPkW4GNQxunmYTeJIjHFrvilcNuHBWrfgbyvmagEmfGOA4hnP1WIkPbv4yABhj1Nam3as4w+7MBiI27BntwqVg=="
}
}
}