Order fix and more diagnosis

merge-requests/4/head
Bsian 2020-01-04 11:18:38 +00:00
parent 59ae64b08f
commit 9809f32ee0
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 5 additions and 4 deletions

View File

@ -47,20 +47,21 @@ export default class Eval extends Command {
this.client.signale.note('Main'); this.client.signale.note('Main');
this.client.signale.note(args); this.client.signale.note(args);
try { try {
this.client.signale.note(evalString);
evaled = await eval(evalString); evaled = await eval(evalString);
this.client.signale.note('evaluated with success'); this.client.signale.note('evaluated with success');
this.client.signale.note(evaled); this.client.signale.note(evaled);
this.client.signale.note(typeof evaled); this.client.signale.note(typeof evaled);
if (evaled === undefined) {
this.client.signale.note('Eval undefined');
evaled = 'undefined';
}
if (typeof evaled !== 'string') { if (typeof evaled !== 'string') {
this.client.signale.note('Eval returned not a string. Depth setting:'); this.client.signale.note('Eval returned not a string. Depth setting:');
this.client.signale.note(depth); this.client.signale.note(depth);
evaled = inspect(evaled, { depth }); evaled = inspect(evaled, { depth });
this.client.signale.note('Inspected'); this.client.signale.note('Inspected');
} }
if (evaled === undefined) {
this.client.signale.note('Eval undefined');
evaled = 'undefined';
}
} catch (error) { } catch (error) {
this.client.signale.note('Error caught'); this.client.signale.note('Error caught');
evaled = error.stack; evaled = error.stack;