chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a582d1
)
better error handling in js
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Thu, 3 Sep 2020 01:13:40 +0000
(
02:13
+0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Thu, 3 Sep 2020 01:13:40 +0000
(
02:13
+0100)
templates/script.ts
patch
|
blob
|
history
diff --git
a/templates/script.ts
b/templates/script.ts
index 4a5b66ad562a878634c820c601a608d2f53c6e82..fde8099f31325e1904ce99cedf77dc390ffaaebe 100644
(file)
--- a/
templates/script.ts
+++ b/
templates/script.ts
@@
-114,8
+114,12
@@
function xhr_report_error(xhr: XMLHttpRequest) {
function json_report_error(error_for_json: Object) {
let error_message = JSON.stringify(error_for_json);
+ string_report_error(error_message);
+}
+
+function string_report_error(error_message: String) {
let errornode = document.getElementById('error')!;
- errornode.textContent
= '
Error (reloading may help?):' + error_message;
+ errornode.textContent
+= '\n
Error (reloading may help?):' + error_message;
}
function api(meth: string, data: Object) {