Skip to content

Commit

Permalink
fix: suppressConsoleErrorAsync now suppresses the error
Browse files Browse the repository at this point in the history
  • Loading branch information
macalinao committed Jan 5, 2022
1 parent 1635a81 commit 5dcd3ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/solana-contrib/src/utils/misc.ts
@@ -1,3 +1,7 @@
const noop = () => {
// noop
};

/**
* Hide the console.error because @solana/web3.js often emits noisy errors as a
* side effect. There are use cases of estimateTransactionSize where we
Expand All @@ -7,6 +11,7 @@ export const suppressConsoleErrorAsync = async <T>(
fn: () => Promise<T>
): Promise<T> => {
const oldConsoleError = console.error;
console.error = noop;
try {
const result = await fn();
console.error = oldConsoleError;
Expand Down

0 comments on commit 5dcd3ff

Please sign in to comment.