Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement better error log before the unwrap. #10

Open
DFL-Levi opened this issue Jul 20, 2021 · 1 comment
Open

Implement better error log before the unwrap. #10

DFL-Levi opened this issue Jul 20, 2021 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@DFL-Levi
Copy link

NonZeroU64::new(max_native_pc_qty).unwrap(),

When creating the new token it was returning the promise but i missed it. I was not waiting but the error log i got was pretty bad:
Program log: panicked at 'called Option::unwrap() on a None value', programs/swap/src/lib.rs:527:48

I think program should provide a better error for that case!
As i checked with developer of serum he told me: We can simply add some require! statements before the unwrap.

@armaniferrante armaniferrante added help wanted Extra attention is needed good first issue Good for newcomers labels Jul 20, 2021
@beautyfree
Copy link

beautyfree commented Jul 29, 2021

Faced a similar error:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants