use std::error::Error;
use thiserror::Error as ErrorDerive;
use crate::error::DiscoverProjectError;
use crate::project::ConfigurationPath;
#[derive(Debug, ErrorDerive)]
#[non_exhaustive]
pub enum LoadProjectError {
#[error(transparent)]
#[non_exhaustive]
UndiscoverableProject {
source: DiscoverProjectError,
},
#[error("failed to create the configuration file of the project at `{path}`")]
#[non_exhaustive]
UncreatableConfiguration {
path: ConfigurationPath,
source: Box<dyn Error + Send + Sync>,
},
#[error("failed to load the configuration file of the project at `{path}`")]
#[non_exhaustive]
UnloadableConfiguration {
path: ConfigurationPath,
source: Box<dyn Error + Send + Sync>,
},
}
#[cfg(test)]
mod tests {
#![allow(clippy::missing_panics_doc)]
use super::*;
#[test]
fn load_project_error_is_send_and_sync() {
fn assert_send_and_sync<T: Send + Sync>() {}
assert_send_and_sync::<LoadProjectError>();
}
}