fhstp / easynwk-web

egocentric network map for social work
MIT License
1 stars 0 forks source link

sanity check JSON on loading #34

Open alex-rind opened 3 years ago

alex-rind commented 3 years ago

currently: no sanity checks are performed, the app breaks, broken state is persisted to localstorage, and manual deleting localstorage is needed (i.e., high severity)

alex-rind commented 3 years ago

if a non JSON file is uploaded the vue error handler is not called. Console shows:

VM42356:1 Uncaught SyntaxError: Unexpected token % in JSON at position 0 at JSON.parse () at loadNWK (NWK.ts?c3cb:33) at Store.loadNWK (nwkModule.ts?aad3:43) at wrappedMutationHandler (vuex.esm-browser.js?5502:298) at commitIterator (vuex.esm-browser.js?5502:982) at Array.forEach () at eval (vuex.esm-browser.js?5502:981) at Store._withCommit (vuex.esm-browser.js?5502:1139) at Store.commit (vuex.esm-browser.js?5502:980) at Store.boundCommit [as commit] (vuex.esm-browser.js?5502:917)