zmitchell / splatter

A Rust framework for creating generative art
0 stars 0 forks source link

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

Open zmitchell opened 10 months ago

zmitchell commented 10 months ago

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