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

Bad error message if a todo!() is encountered in view function. #59

Open
zmitchell opened this issue Nov 5, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@zmitchell
Copy link
Owner

Describe the bug
If you have a todo!() in your view function you'll see something like this output:

thread 'main' panicked at 'not yet implemented', src/main.rs:116:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/zmitchell/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.3/src/platform_impl/macos/app_state.rs:377:33

Note the error message about unwrapping on a PoisonError. A user may not see the first line stating that a panic occurred due to not yet implemented and go on a scavenger hunt trying to figure out what's going on with this PoisonError.

To Reproduce

  1. Create a new sketch/app
  2. In the first line of view add a todo!()
  3. cargo run
  4. See error

Expected behavior
The user should either only see an error message about not yet implemented or there should be some other informative error message indicating what went wrong.

System info (please complete the following information):
All

Additional context
N/A

@zmitchell zmitchell added the bug Something isn't working label Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant