Skip to main content

distrib_ruby/
error.rs

1// This is free and unencumbered software released into the public domain.
2
3use alloc::{
4    boxed::Box,
5    string::{String, ToString},
6};
7use distrib_common::BoxError;
8use thiserror::Error;
9
10#[derive(Debug, Error)]
11pub enum LoadGemspecError {
12    #[error(transparent)]
13    Other(#[from] BoxError),
14}
15
16#[cfg(feature = "std")]
17impl From<std::io::Error> for LoadGemspecError {
18    fn from(error: std::io::Error) -> Self {
19        Self::Other(error.into())
20    }
21}
22
23impl From<serde_norway::Error> for LoadGemspecError {
24    fn from(error: serde_norway::Error) -> Self {
25        Self::Other(error.into())
26    }
27}