mqtt-rs icon indicating copy to clipboard operation
mqtt-rs copied to clipboard

Simpler errors

Open vincentdephily opened this issue 6 years ago • 3 comments

Fixes https://github.com/zonyitoo/mqtt-rs/issues/34

This is still a work in progress (I'd like to simplify a couple more types, investigate some potential bugs I noticed, and maybe add a test or two), but I'd like a review at this stage, particularly of the last commit. You might find the commit message, PacketError doc, and errortypes.svg useful.

Thanks.

vincentdephily avatar Jun 27 '19 16:06 vincentdephily

I'll stop there, unless you have some comments or suggestions. There's a good bit more that could be done, but I've already spent more time than I expected on this and need to move on.

One alternative we could investigate is using a crate like snafu to chain errors and get much more details, but pragmatically I think the current info is all you need. I'll be dogfooding this branch in my own app next, we'll see.

vincentdephily avatar Jun 28 '19 17:06 vincentdephily

Great job! LGTM.

zonyitoo avatar Jun 29 '19 06:06 zonyitoo

Looking forward to see your further improvement.

zonyitoo avatar Jun 29 '19 06:06 zonyitoo