neo-devpack-solidity 0.22.0

Production-focused Solidity-to-NeoVM compilation system
Documentation
/// Errors from Solidity compilation
#[derive(Debug, Error)]
pub enum SolidityError {
    #[error("{0}")]
    Frontend(#[from] crate::frontend::FrontendError),

    #[error("{0}")]
    Analysis(String),

    #[error("no contract definitions found in source")]
    NoContracts,

    #[error("contract '{0}' not found")]
    ContractNotFound(String),

    #[error("unsupported feature: {0}")]
    UnsupportedFeature(String),

    #[error("inheritance error: {0}")]
    InheritanceError(String),
}

impl SolidityError {
    /// Create an analysis error
    pub fn analysis(msg: impl Into<String>) -> Self {
        Self::Analysis(msg.into())
    }

    /// Create an unsupported feature error
    pub fn unsupported(feature: impl Into<String>) -> Self {
        Self::UnsupportedFeature(feature.into())
    }

    /// Check if this error is recoverable
    pub fn is_recoverable(&self) -> bool {
        matches!(self, Self::UnsupportedFeature(_))
    }
}