Closed clearloop closed 4 years ago
error.isModule && console.error(api.registry.findMetaError(error.asModule))
error.isModule && console.error(api.registry.findMetaError(error.asModule))
Thanks!!! It works!
For example, my current code is like:
function parseRes(r: any) {
let status = r.status;
log(`Transaction status: ${status.type}`);
if (status.isInBlock) {
log(`Included at block hash: ${status.asInBlock.toHex()}`);
r.events && r.events.forEach(async (r: any) => {
log(
"\t" +
r.phase.toString() +
`: ${r.event.section}.${r.event.method}` +
r.event.data.toString()
);
// error
if (r.event.data[0].isModule) {
let doc = await this.api.registry.findMetaError(r.event.data[0].asModule);
let err = `${doc.name}.${doc.section} - ${doc.documentation.join(" ")}`
log(err, Logger.Error);
process.exit(1);
}
});
} else if (status.isFinalized) {
log(`Finalized block hash: ${status.asFinalized.toHex()}`);
this.queue.active = false;
this.queue.finished = true;
}
}
It would be nice to mention this in https://polkadot.js.org/api/
and add something like a search box to find docs by keyword efficiently~
Agreed. So the reality is that I can either code, or write docs - so atm with all the changes, docs are lagging a lot.
Having said all that - PRs are really very welcome to enhance. I love anything, code, docs.
Agreed. So the reality is that I can either code, or write docs - so atm with all the changes, docs are lagging a lot.
Me too, I don't even have time to code for fun, things just come as they are one by one, I wish that I can separate another my self firing to the doc/code
, frontend business is just so much complex.
:)
I think things should die down a bit when Substrate 2.x is out the door - that will give a gap to catch up here, a helluva lot of gaps for new stuff atm :( I left pointers in the CHANGELOGs, but without reading, stuff is just hidden.
Will get there.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.
Desc
For example:
The
{"Module":{"index":25,"error":10}}
is not friendly for testing.And more...
How to hide the default polkadot API log?
This breaks my formats.