Stream: project-error-handling

Topic: error-chain


view this post on Zulip Andrew Gauger (Sep 18 2020 at 22:46):

So I've been maintaining error-chain to make sure new updates to the rust language don't break crates using error-chain and I thought I should solicit some feedback from this group regarding those intentions.

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:47):

I think this would be covered by the pre existing stability guaruntees of the language, in that we cannot break code that already compiles

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:47):

not sure if im misunderstanding

view this post on Zulip Andrew Gauger (Sep 18 2020 at 22:48):

Here's an example: https://github.com/rust-lang-nursery/error-chain/commit/ea8171169aec77043d132ae5799692d0305d2d59

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:51):

I can't think of any plans that would deprecate anything off of the top of my head

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:51):

let me double check the charter tho

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:52):

i think the biggest issue might be supporting new features while maintaining support for older compiler versions

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:52):

basically what you've already done

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:52):

i could forsee some issues around backtrace

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:52):

but i think thats already gonna be an issue either way

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:53):

or maybe its fine

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:53):

i dont know

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:53):

I should definitely look into how error-chain works more closely

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:54):

its one of the libraries that I never looked into because when I started using rust a few years ago failure was all the rage and error-chain was already the "old" way of doing things :/

view this post on Zulip Andrew Gauger (Sep 18 2020 at 22:54):

lol yep, that's the story with error-chain

view this post on Zulip Andrew Gauger (Sep 18 2020 at 22:54):

backtrace has already been the biggest struggle.

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:54):

also the syntax of the macro seems pretty unique

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:54):

:/

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:55):

so then there are two other features that I would like to pursue that would have similar implications on error-chain

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:55):

first, this rfc

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:55):

https://github.com/yaahc/rfcs/blob/master/text/0000-dyn-error-generic-member-access.md

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:55):

which proposes another method on the error trait that acts like a generic version of fn backtrace

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:56):

well, more accurately it superscedes both backtrace and source

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:56):

in theory, not sure if ppl would use it that way in practice

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:56):

the other feature is error return traces, which is related to that RFC

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:57):

https://github.com/yaahc/nostd-error-poc/blob/master/fakecore/src/result.rs#L58

view this post on Zulip Andrew Gauger (Sep 18 2020 at 22:57):

Great, I'm not concerned with new features, but I'll read the RFC because, like you, I like rust error handling story.

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:58):

the idea being that we'd have some way to pass locations into errors during ? so they could track every location they're propagated from

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:58):

ill take a closer look at error-chain though and get familiar with its API and impl

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:58):

so I can make sure we account for it in our discussions

view this post on Zulip Jane Lusby (Sep 18 2020 at 22:58):

(or you should come to our meetings)

view this post on Zulip Andrew Gauger (Sep 18 2020 at 23:00):

Its pre-Error type so it was the basis for some of the things that went into std. There's some crates afaik that still use it. I was maintaining it for mdbook but that looks like its moved to anyhow now.


Last updated: Jan 26 2022 at 14:20 UTC