More diagnosis

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

View File

@ -23,6 +23,8 @@ export default class Eval extends Command {
let evaled: any; let evaled: any;
let depth = 0; let depth = 0;
this.client.signale.note('Received'); this.client.signale.note('Received');
this.client.signale.note(message);
this.client.signale.note(args);
if (args[0] && args[0].startsWith('-d')) { if (args[0] && args[0].startsWith('-d')) {
this.client.signale.note('Depth flag'); this.client.signale.note('Depth flag');
@ -32,20 +34,26 @@ export default class Eval extends Command {
args.shift(); args.shift();
evalString = args.join(' ').trim(); evalString = args.join(' ').trim();
this.client.signale.note('Eval reconfigured'); this.client.signale.note('Eval reconfigured');
this.client.signale.note(args);
} }
if (args[0] === '-a' || args[0] === '-async') { if (args[0] === '-a' || args[0] === '-async') {
this.client.signale.note('Async flag'); this.client.signale.note('Async flag');
args.shift(); args.shift();
evalString = `(async () => { ${args.join(' ').trim()} })()`; evalString = `(async () => { ${args.join(' ').trim()} })()`;
this.client.signale.note('Eval reconfigured'); this.client.signale.note('Eval reconfigured');
this.client.signale.note(args);
} }
this.client.signale.note('Main'); this.client.signale.note('Main');
this.client.signale.note(args);
try { try {
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(typeof evaled);
if (typeof evaled !== 'string') { if (typeof evaled !== 'string') {
this.client.signale.note('Eval returned not a string'); this.client.signale.note('Eval returned not a string. Depth setting:');
this.client.signale.note(depth);
evaled = inspect(evaled, { depth }); evaled = inspect(evaled, { depth });
this.client.signale.note('Inspected'); this.client.signale.note('Inspected');
} }