From ac8d100ec60aa17afbcb0d5b99678356549d2883 Mon Sep 17 00:00:00 2001 From: Dario Kampkaspar Date: Thu, 22 Nov 2018 16:57:29 +0100 Subject: [PATCH] iclude project function to handle errors e.g. to re-authorize Cf. https://github.com/dariok/wienerdiarium/issues/25 Cf. #3 --- form.js | 3 +++ process.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/form.js b/form.js index 581f689..c99855d 100644 --- a/form.js +++ b/form.js @@ -38,6 +38,9 @@ $.ajax({ return { results: process(data) }; + }, + error: function ( jqXHR, textStatus, errorThrown ) { + handleError ( jqXHR, textStatus, errorThrown ); } } }); diff --git a/process.js b/process.js index 9598db0..3977426 100644 --- a/process.js +++ b/process.js @@ -16,4 +16,8 @@ function queryString (conf, params) { "_type": "query" } return query +} + +function handleError (jqXHR, textStatus, errorThrown) { + console.log(jqXHR + " – " + textStatus + " – " + errorThrown); } \ No newline at end of file