git.delta.rocks / unique-network / refs/commits / c6880a4e70ee

difftreelog

Hide unneeded websocker errors

Greg Zaitsev2021-02-11parent: #cb095c7.patch.diff
in: master

1 file changed

modifiedtests/src/substrate/substrate-api.tsdiffbeforeafterboth
22 settings = settings || defaultApiOptions();22 settings = settings || defaultApiOptions();
23 let api: ApiPromise = new ApiPromise(settings);23 let api: ApiPromise = new ApiPromise(settings);
24
25 // TODO: Remove, this is temporary: Filter unneeded API output
26 // (Jaco promised it will be removed in the next version)
27 const consoleErr = console.error;
28 console.error = (message: string) => {
29 if (message.includes("StorageChangeSet:: WebSocket is not connected") || message.includes("2021-")) {}
30 else consoleErr(message);
31 };
2432
25 try {33 try {
26 await promisifySubstrate(api, async () => {34 await promisifySubstrate(api, async () => {
31 })();39 })();
32 } finally {40 } finally {
33 await api.disconnect();41 await api.disconnect();
42 console.error = consoleErr;
34 }43 }
35}44}
3645