Skip to content

Conversation

@arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Nov 6, 2024

PR-Codex overview

This PR focuses on enhancing error handling in the codebase. It introduces a new function wrapError to standardize error messages and updates several parts of the code to utilize this new function, improving clarity and consistency in error reporting.

Detailed summary

  • Added wrapError function to standardize error messages.
  • Updated prettifyError function for concise error message formatting.
  • Replaced prettifyError with wrapError in error handling logic across several functions.
  • Enhanced error handling in _sendUserOp and _sendTransaction to include specific insufficient funds messages.
  • Modified error logging to use the new error handling approach.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

return stringify(error);
};

export const prettifyTransactionError = async (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function was used to prettify an error. But the "simulate" step below wasn't used since v5 isn't returning ethers error codes anymore. Moving the insufficient funds logic inline in SendTransactionWorker.

@arcoraven arcoraven merged commit ee9c4ee into main Nov 7, 2024
5 checks passed
@arcoraven arcoraven deleted the ph/showOutOfFundsAmount branch November 7, 2024 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants