diff options
author | sijanec <sijanecantonluka@gmail.com> | 2020-05-20 13:29:12 +0200 |
---|---|---|
committer | sijanec <sijanecantonluka@gmail.com> | 2020-05-20 13:29:12 +0200 |
commit | f42bec58d38bcc5458dc9ab12a46a2e8f7c990e2 (patch) | |
tree | 25eee64ec49c14a567d77eecc2eefae2e9879b10 /assets/js | |
parent | CSS fixes (diff) | |
download | beziapp-f42bec58d38bcc5458dc9ab12a46a2e8f7c990e2.tar beziapp-f42bec58d38bcc5458dc9ab12a46a2e8f7c990e2.tar.gz beziapp-f42bec58d38bcc5458dc9ab12a46a2e8f7c990e2.tar.bz2 beziapp-f42bec58d38bcc5458dc9ab12a46a2e8f7c990e2.tar.lz beziapp-f42bec58d38bcc5458dc9ab12a46a2e8f7c990e2.tar.xz beziapp-f42bec58d38bcc5458dc9ab12a46a2e8f7c990e2.tar.zst beziapp-f42bec58d38bcc5458dc9ab12a46a2e8f7c990e2.zip |
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/app.js.bvr (renamed from assets/js/app.js) | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/assets/js/app.js b/assets/js/app.js.bvr index b2623b9..f601506 100644 --- a/assets/js/app.js +++ b/assets/js/app.js.bvr @@ -1,3 +1,7 @@ +<@?i global@> +const app_version = "<@?g app_version@>"; +const previous_commit = "<@?g latest_commit@>"; + if ("serviceWorker" in navigator) { navigator.serviceWorker.register("/sw.js") .then(() => { }) @@ -50,7 +54,10 @@ function gsecErrorHandlerUI(err) { window.onerror = function (msg, url, lineNo, columnNo, error) { - // ... handle error ... - console.log("error!"); - return false; + var data = {}; + data.error = {"msg": msg, "url": url, "line": lineNo, "column": columnNo, "obj": error}; + data.client = {"ua": navigator.userAgent, "app_version": app_version, "previous_commit": previous_commit}; + data.type = "error"; + $.post("https://beziapp-report.gimb.tk/", data); + return false; } |