yakui icon indicating copy to clipboard operation
yakui copied to clipboard

Error handling

Open Uriopass opened this issue 6 months ago • 1 comments

Sometimes parameter don't make sense: negative radius, flex=0 for a spacer.

I also think of infinitely sized objects that can crash the painter in debug (overflow error when building the rect).

What should be the strategy to help the user?

I can think of a few ways:

  • debug_assert! or log::error at the right places
  • Newtypes like NonZeroX or PositiveX (not very ergonomic)
  • Some kind of debug mode, like an inspector that could highlight issues/sizes/constraints

Uriopass avatar Dec 24 '23 11:12 Uriopass