mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Small refractor of throw/errors-s
This commit is contained in:
parent
ff25bff70e
commit
a9f9d1951f
1 changed files with 3 additions and 6 deletions
9
main.js
9
main.js
|
@ -949,7 +949,7 @@ function Version15 () {
|
|||
'<h1>Moodle teszt userscript:<h1><h3>1.5.0 verzió: a script mostantól XMLHTTP kéréseket küld szerver fele! Erre a userscript futtató kiegészitőd is figyelmeztetni fog! Ha ez történik, a script rendes működése érdekében engedélyezd (Always allow domain)! Ha nem akarod, hogy ez történjen, akkor ne engedélyezd, vagy a menüben válaszd ki a "helyi fájl használata" opciót!</h3> <h3>Elküldött adatok: minden teszt után a kérdés-válasz páros. Fogadott adatok: Az összes eddig ismert kérdés. Érdemes help-et elolvasni!!!</h3><h5>Ez az ablak frissités után eltűnik. Ha nem, akkor a visza gombbal próbálkozz.</h5>'
|
||||
)
|
||||
document.close()
|
||||
throw 'something, so this stuff stops' // eslint-disable-line
|
||||
throw new Error('something, so this stuff stops')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -983,7 +983,7 @@ function ReadFile (cwith) {
|
|||
return
|
||||
}
|
||||
if (SUtils.EmptyOrWhiteSpace(resource)) {
|
||||
throw 'data file empty' // eslint-disable-line
|
||||
throw new Error('data file empty')
|
||||
}
|
||||
} catch (e) {
|
||||
Exception(e, 'script error at reading file:')
|
||||
|
@ -1338,10 +1338,7 @@ function GetImageFormResult (i) {
|
|||
function SaveQuiz (quiz, questionData) {
|
||||
try {
|
||||
if (quiz.length === 0) {
|
||||
throw { // eslint-disable-line
|
||||
message: 'quiz length is zero!',
|
||||
stack: 'no stack.'
|
||||
}
|
||||
throw new Error('quiz length is zero!')
|
||||
}
|
||||
var output = '' // thefinal output
|
||||
var allOutput = '' // thefinal output with all questions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue