imag-mail: Rewrite error handling
This commit is contained in:
parent
69b3fe52c6
commit
2b845c773b
1 changed files with 2 additions and 2 deletions
|
@ -68,14 +68,14 @@ fn import_mail(rt: &Runtime) {
|
||||||
|
|
||||||
fn list(rt: &Runtime) {
|
fn list(rt: &Runtime) {
|
||||||
use libimagmail::error::MailErrorKind as MEK;
|
use libimagmail::error::MailErrorKind as MEK;
|
||||||
use libimagmail::error::MapErrInto;
|
use libimagmail::error::ResultExt;
|
||||||
|
|
||||||
let store = rt.store();
|
let store = rt.store();
|
||||||
|
|
||||||
let iter = match store.retrieve_for_module("ref") {
|
let iter = match store.retrieve_for_module("ref") {
|
||||||
Ok(iter) => iter.filter_map(|id| {
|
Ok(iter) => iter.filter_map(|id| {
|
||||||
Ref::get(store, id)
|
Ref::get(store, id)
|
||||||
.map_err_into(MEK::RefHandlingError)
|
.chain_err(|| MEK::RefHandlingError)
|
||||||
.and_then(|rf| Mail::from_ref(rf))
|
.and_then(|rf| Mail::from_ref(rf))
|
||||||
.map_err_trace()
|
.map_err_trace()
|
||||||
.ok()
|
.ok()
|
||||||
|
|
Loading…
Reference in a new issue