-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
epub_builder::Error no longer available for use in next release. #30
Comments
You can always pin eyre to the same release as it is here, but I understand that's not an ideal solution 🤷 |
Agree with @dieterplex now eyre is leaking from epub-builder into another library (mdbook-epub). That was not an good solution, imho. |
Can error be converted to std::error::Error so that there is no need to leak the eyre, I use this to convert to anyhow: use std::error::Error;
type EpubBuilderError = Arc<dyn Error + Send + Sync + 'static>;
pub trait IntoStdError<T> {
fn into_std_error(self) -> Result<T, EpubBuilderError>;
}
impl<T> IntoStdError<T> for epub_builder::Result<T> {
fn into_std_error(self) -> Result<T, EpubBuilderError> {
match self {
Ok(it) => Ok(it),
Err(e) => {
let err: Box<dyn Error + Send + Sync + 'static> = e.into();
let err: Arc<dyn Error + Send + Sync + 'static> = Arc::from(err);
Err(err)
}
}
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since 1e3af55,
epub_builder::Error
is no longer available for using in downstream project. Specifically mdbook-epub is usingepub_builder::Error
to define a transparent error variant ofthiserror
. Without that, it would need to introduce eyre as a dependency IIUC and have some changes to upgrade to next release.Could you consider re-exporting
eyre::Report
as Error for compatibility? Or give guidance to migrate?Edit: see also Eyre's doc
The text was updated successfully, but these errors were encountered: