Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Convert code base to Error/ErrorKind pattern #769

Open
ncalexan opened this issue Jun 26, 2018 · 1 comment
Open

Convert code base to Error/ErrorKind pattern #769

ncalexan opened this issue Jun 26, 2018 · 1 comment
Labels
A-core A-design Planning and overall architecture. A-ffi dev-ergonomics Issues concerning developer ergonomics - making mentat easy and pleasant to use. enhancement

Comments

@ncalexan
Copy link
Member

#730 did heroic work to convert from error-chain to failure, but our initial consumer (a logins API that consumes Mentat and is in turn consumed by applications like Mozilla Lockbox) is finding that returning failure::Error isn't very helpful. It looks like we'll need to adopt the Error/ErrorKind pattern from https://github.com/withoutboats/failure/blob/868273409c826755812dbff1b67cc0ac3fa702f7/book/src/error-errorkind.md.

@ncalexan ncalexan added enhancement A-core A-design Planning and overall architecture. A-ffi dev-ergonomics Issues concerning developer ergonomics - making mentat easy and pleasant to use. labels Jun 26, 2018
@ncalexan
Copy link
Member Author

@grigoryk I think we talked about this, but clearly I didn't understand the full context of what's involved. I see TODO items in the code to do this work in some places; do you have a strong opinion about this approach?

ncalexan added a commit that referenced this issue Jun 27, 2018
…r=grisha

In the language of
https://github.com/withoutboats/failure/blob/868273409c826755812dbff1b67cc0ac3fa702f7/book/src/error-errorkind.md
Mentat is a mid-level API, not an application, and therefore we should
prefer our own error types.  Writing an initial consumer of Mentat (a
Rust logins API targeting Mozilla Lockbox), I have found this to be
true: my consumer wants to consume concrete Mentat error types.

This doesn't go "all the way" and convert all sub-crates to the
Error/ErrorKind, but it does go part of the way.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-core A-design Planning and overall architecture. A-ffi dev-ergonomics Issues concerning developer ergonomics - making mentat easy and pleasant to use. enhancement
Projects
None yet
Development

No branches or pull requests

1 participant