Skip to content

[chore] Hot Fix Examples Async/Await Execution - #11

Open
lizard-boy wants to merge 1 commit into
masterfrom
hot-fix-examples
Open

[chore] Hot Fix Examples Async/Await Execution#11
lizard-boy wants to merge 1 commit into
masterfrom
hot-fix-examples

Conversation

@lizard-boy

Copy link
Copy Markdown

What changed? Why?

  • Our examples define async functions. Currently, they are not awaited which can result in the execution of the script completed before the promise resolves
  • The examples are updated to properly handle the example function calls

Qualified Impact

@dakshgup

Copy link
Copy Markdown

@greptileai

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PR Summary

This pull request updates the example files in the src/examples directory to properly handle asynchronous function calls and improve error handling.

  • Wrapped main function calls in immediately invoked async functions (IIFEs) with try-catch blocks in all example files
  • Removed unnecessary await keyword from wallet.getDefaultAddress() in create_wallet.js
  • Ensured proper awaiting of async functions to prevent premature script termination
  • Improved error logging for better debugging and user feedback in all examples

4 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

try {
await fundWallet();
} catch (error) {
console.error("Error during funding wallet", error);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

style: Consider adding more detailed error logging, such as including the error stack trace

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