forked from engineering/cloudservices
More diagnosis
parent
f5ae4392be
commit
59ae64b08f
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue