summaryrefslogtreecommitdiffstats
path: root/web/error.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/error.js')
-rw-r--r--web/error.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/web/error.js b/web/error.js
new file mode 100644
index 0000000..c5c184a
--- /dev/null
+++ b/web/error.js
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2012-2014 Kaarle Ritvanen
+ * See LICENSE file for license details
+ */
+
+define(function() {
+ return function(msg, xhr) {
+ msg += " " + xhr.statusCode().status;
+ if (xhr.responseText) msg += ': ' + xhr.responseText;
+ return msg;
+ }
+});