From d0c4361e579447189422c377ffc83614cbe865af Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 25 Nov 2017 16:42:28 +0100 Subject: zelfoverhoor: Fix HEAD^ --- modules/zelfoverhoor/docent.js | 4 ++-- modules/zelfoverhoor/qs.js | 4 ++-- modules/zelfoverhoor/zelfoverhoor.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/zelfoverhoor/docent.js b/modules/zelfoverhoor/docent.js index 2aef2e8..35d2da7 100644 --- a/modules/zelfoverhoor/docent.js +++ b/modules/zelfoverhoor/docent.js @@ -1,8 +1,8 @@ window.addEventListener("error",function(err){ - console.log(JSON.stringify(err)); + var str=err.filename+":"+err.lineno+" "+err.error+": "+err.message; var xhr=new XMLHttpRequest(); xhr.open("POST","/zelfoverhoor/error"); - xhr.send(JSON.stringify(err)); + xhr.send(str); }); var questionsets=null; diff --git a/modules/zelfoverhoor/qs.js b/modules/zelfoverhoor/qs.js index c07f8be..e9aedb5 100644 --- a/modules/zelfoverhoor/qs.js +++ b/modules/zelfoverhoor/qs.js @@ -1,8 +1,8 @@ window.addEventListener("error",function(err){ - console.log(JSON.stringify(err)); + var str=err.filename+":"+err.lineno+" "+err.error+": "+err.message; var xhr=new XMLHttpRequest(); xhr.open("POST","/zelfoverhoor/error"); - xhr.send(JSON.stringify(err)); + xhr.send(str); }); var setname=questionset.name; diff --git a/modules/zelfoverhoor/zelfoverhoor.js b/modules/zelfoverhoor/zelfoverhoor.js index d1d3068..766bffd 100644 --- a/modules/zelfoverhoor/zelfoverhoor.js +++ b/modules/zelfoverhoor/zelfoverhoor.js @@ -222,7 +222,7 @@ module.exports=function(app,io,_moddir){ app.post("/zelfoverhoor/error",function(req,res){ if(typeof req.body=="string"){ - fs.appendFile(moddir+"/errors.txt",req.body,function(err){ + fs.appendFile(moddir+"/errors.txt",new Date().toString()+" "+req.body+"\n",function(err){ if(err)console.log(err); }); } -- cgit v1.2.3-70-g09d2