seed icon indicating copy to clipboard operation
seed copied to clipboard

Add tips to handler panic message

Open MartinKavik opened this issue 5 years ago • 4 comments
trafficstars

... can return only Msg, Option<Msg> or ()! is the current panic message.

In the most cases users try to use incompatible Msg type (e.g. the parent's one instead of the submodule's one). We should advice them to check the Msg type and add a note that it will be changed to a compile-time error once it's possible in stable Rust.

Some related issues:

  • https://github.com/seed-rs/seed/issues/500
  • https://github.com/seed-rs/seed/issues/391

MartinKavik avatar Jul 18 '20 12:07 MartinKavik

I went through this exact thing. Say the word and I'll do it. I'm assuming it's a relatively trivial change to docs?

Ben-PH avatar Jul 18 '20 14:07 Ben-PH

Yeah, just small docs/comments changes. However they on relatively many places. I would be glad if you do it and it would be also better because I haven't encountered those problems by myself.

MartinKavik avatar Jul 18 '20 15:07 MartinKavik

righto. In that case I'll do a grep for something like //!.*?return only Msg, Option<Msg> or ()!. If you can recommend a better grep, that would help.

I'll also look at the changes made in #499

Ben-PH avatar Jul 18 '20 15:07 Ben-PH

I would just open VS Code, press Ctrl+Shift+F and write Msg, Option<Msg>.. it should be enough I hope.

MartinKavik avatar Jul 18 '20 17:07 MartinKavik