summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/codeq/init.js7
-rw-r--r--js/codeq/prolog.js7
-rw-r--r--js/codeq/python.js7
-rw-r--r--js/codeq/robot.js7
4 files changed, 16 insertions, 12 deletions
diff --git a/js/codeq/init.js b/js/codeq/init.js
index f34382a..ea8b93c 100644
--- a/js/codeq/init.js
+++ b/js/codeq/init.js
@@ -93,9 +93,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
//For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning you must initialize them yourself.
$('[data-toggle="popover"]').popover()
})
- .fail(function (e) {
- codeq.log.error('CodeQ failed to start: ' + e, e);
- alert('CodeQ failed to start: ' + e);
+ .fail(function (error) {
+ var message = 'CodeQ initialization failed: ' + error.message;
+ codeq.log.error(message, error);
+ alert(message);
})
.done();
};
diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js
index 194f6a8..c361b03 100644
--- a/js/codeq/prolog.js
+++ b/js/codeq/prolog.js
@@ -43,9 +43,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
codeq.loadProblemData(ref, data).then(function (problem) {
enterFun(problem.generalProblemData, data.commonDef, problem.solution);
})
- .fail(function (reason) {
- codeq.log.error('Failed to obtain the problem definition: ' + reason, reason);
- alert('Failed to obtain the problem definition: ' + reason);
+ .fail(function (error) {
+ var message = 'Could not obtain problem definition: ' + error.message;
+ codeq.log.error(message, error);
+ alert(message);
history.back();
})
.done();
diff --git a/js/codeq/python.js b/js/codeq/python.js
index 085ebfc..ada3954 100644
--- a/js/codeq/python.js
+++ b/js/codeq/python.js
@@ -42,9 +42,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
codeq.loadProblemData(ref, data).then(function (problem) {
enterFun(problem.generalProblemData, data.commonDef, problem.solution);
})
- .fail(function (reason) {
- codeq.log.error('Failed to obtain the problem definition: ' + reason, reason);
- alert('Failed to obtain the problem definition: ' + reason);
+ .fail(function (error) {
+ var message = 'Could not obtain problem definition: ' + error.message;
+ codeq.log.error(message, error);
+ alert(message);
history.back();
})
.done();
diff --git a/js/codeq/robot.js b/js/codeq/robot.js
index 5936d56..bf9200f 100644
--- a/js/codeq/robot.js
+++ b/js/codeq/robot.js
@@ -42,9 +42,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
codeq.loadProblemData(ref, data).then(function (problem) {
enterFun(problem.generalProblemData, data.commonDef, problem.solution);
})
- .fail(function (reason) {
- codeq.log.error('Failed to obtain the problem definition: ' + reason, reason);
- alert('Failed to obtain the problem definition: ' + reason);
+ .fail(function (error) {
+ var message = 'Could not obtain problem definition: ' + error.message;
+ codeq.log.error(message, error);
+ alert(message);
history.back();
})
.done();