These are chat archives for rust-lang/rust

9th
Jun 2018
btw If you find better examples notify me. I am also interested
dovreshef
@dovreshef
Jun 09 2018 18:52
@xoac I did. But I am not sure I understand still how to use it.
I am confused. A context implements Fail which has both context() and cause(). So am I looking at a tree of diverging errors?
I have a Serde question: Is there an attribute, or some other way, without implementing Deserialize myself, of forbidding empty HashMap for a given field?
Sylwester Rąpała
@xoac
Jun 09 2018 18:57
I think it works that cause() give you prev() err. and context() is like expect() but instead of panic it add context to Err
dovreshef
@dovreshef
Jun 09 2018 19:01
But that context will also have cause method
what will it return?
dovreshef
@dovreshef
Jun 09 2018 22:23
Yes. About the object it returns.
Sylwester Rąpała
@xoac
Jun 09 2018 22:37

I am nobe so I think this can be like this: Contex hase a cause() method that retrun a real Error.

So if u have let myerr = ErSomeErr.contex("While connecting..."); And now cause on myerr return SomeErr