adrienjoly / js-test

💯 Exerciseur / outils d'évaluation d'étudiants -- NOT MAINTAINED ANYMORE
https://js-test-demo.firebaseapp.com/
MIT License
42 stars 9 forks source link

display runtime jailed/eval errors in terminal while `npm run eval-firebase-dumps` #40

Closed adrienjoly closed 6 years ago

adrienjoly commented 6 years ago

as of today, runtime jailed/eval errors are displayed that way in stderr:

Tue, 27 Mar 2018 17:00:21 GMT jailed:sandbox DYNAMIC PLUGIN:95
  const canonicalLines = studentFct.toString()
                                   ^

TypeError: Cannot read property 'toString' of undefined
    at evaluateStudentCode (DYNAMIC PLUGIN:95:36)
    at DYNAMIC PLUGIN:128:3
    at ContextifyScript.Script.runInContext (vm.js:35:29)
    at ContextifyScript.Script.runInNewContext (vm.js:41:15)
    at Object.runInNewContext (vm.js:93:38)
    at executeJailed (/Users/adrienjoly/Dev/eemi/js-test-eemi-2017-2018/node_modules/jailed-node/sandbox/sandbox.js:151:8)
    at execute (/Users/adrienjoly/Dev/eemi/js-test-eemi-2017-2018/node_modules/jailed-node/sandbox/sandbox.js:165:3)
    at process.<anonymous> (/Users/adrienjoly/Dev/eemi/js-test-eemi-2017-2018/node_modules/jailed-node/sandbox/sandbox.js:53:7)
    at emitTwo (events.js:106:13)
    at process.emit (events.js:191:7)

...and are merged with stdout before being logged in eval.log files, because I did not find a proper way to:

adrienjoly commented 6 years ago

=> #27.