diff --git a/components/places/src/ffi.rs b/components/places/src/ffi.rs index 7bfdc4399..211f11e19 100644 --- a/components/places/src/ffi.rs +++ b/components/places/src/ffi.rs @@ -105,6 +105,27 @@ fn get_code(err: &Error) -> ErrorCode { log::info!("The store is corrupt: {}", e); ErrorCode::new(error_codes::DATABASE_CORRUPT) } + ErrorKind::SyncAdapterError(e) => { + use sync15::ErrorKind; + match e.kind() { + ErrorKind::StoreError(store_error) => { + // If it's a type-erased version of one of our errors, try + // and resolve it. + if let Some(places_err) = store_error.downcast_ref::() { + log::info!("Recursing to resolve places error"); + get_code(places_err) + } else { + log::error!("Unexpected sync error: {:?}", err); + ErrorCode::new(error_codes::UNEXPECTED) + } + } + _ => { + // TODO: expose network errors... + log::error!("Unexpected sync error: {:?}", err); + ErrorCode::new(error_codes::UNEXPECTED) + } + } + } err => { log::error!("Unexpected error: {:?}", err);