I have an issue regarding displaying errors. For errors, the logger @polkadot/api uses will write to console even when the error is caught and handled. I am handling and displaying the messages a certain way to fit my needs but then I recieve two errors, one I created and one from the @polkadot/api . I am using HttpProvider instead of WsProvider. Is there a way to suppress @polkadot/api messages?
this.provider = ApiPromise.create({ provider: httpProvider, noInitWarn: true });
This is the provider initialization which is in the class constructor.
try {
this.provider = await this.provider;
const nonce = await this.provider.rpc.system.accountNextIndex(address);
return nonce;
}
catch (e) {
console.log(e);
}
I am creating a separate class methods in which I make requests to the node. In the perfect case scenario after receiving an error I would like to handle it on my own without being displayed in the console.
Best regards!