Make errors non-exhaustive (#299)
This commit is contained in:
parent
d7c14d6695
commit
49154b9863
|
@ -105,6 +105,7 @@ impl Action for FetchAndUnpackNix {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum FetchUrlError {
|
pub enum FetchUrlError {
|
||||||
#[error("Request error")]
|
#[error("Request error")]
|
||||||
|
|
|
@ -96,6 +96,7 @@ impl Action for MoveUnpackedNix {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum MoveUnpackedNixError {
|
pub enum MoveUnpackedNixError {
|
||||||
#[error("Glob pattern error")]
|
#[error("Glob pattern error")]
|
||||||
|
|
|
@ -246,6 +246,7 @@ impl Action for SetupDefaultProfile {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum SetupDefaultProfileError {
|
pub enum SetupDefaultProfileError {
|
||||||
#[error("Glob pattern error")]
|
#[error("Glob pattern error")]
|
||||||
|
|
|
@ -333,6 +333,7 @@ impl Action for ConfigureInitService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum ConfigureNixDaemonServiceError {
|
pub enum ConfigureNixDaemonServiceError {
|
||||||
#[error("No supported init system found")]
|
#[error("No supported init system found")]
|
||||||
|
|
|
@ -107,6 +107,7 @@ impl Action for PlaceChannelConfiguration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum PlaceChannelConfigurationError {
|
pub enum PlaceChannelConfigurationError {
|
||||||
#[error("No root home found to place channel configuration in")]
|
#[error("No root home found to place channel configuration in")]
|
||||||
|
|
|
@ -138,6 +138,7 @@ impl Action for StartSystemdUnit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum StartSystemdUnitError {
|
pub enum StartSystemdUnitError {
|
||||||
#[error("Failed to execute command")]
|
#[error("Failed to execute command")]
|
||||||
|
|
|
@ -95,6 +95,7 @@ impl Action for BootstrapApfsVolume {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum BootstrapVolumeError {
|
pub enum BootstrapVolumeError {
|
||||||
#[error("Failed to execute command")]
|
#[error("Failed to execute command")]
|
||||||
|
|
|
@ -136,6 +136,7 @@ impl Action for CreateApfsVolume {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum CreateApfsVolumeError {
|
pub enum CreateApfsVolumeError {
|
||||||
#[error("Existing volume called `{0}` found in `diskutil apfs list`, delete it with `diskutil apfs deleteVolume \"{0}\"`")]
|
#[error("Existing volume called `{0}` found in `diskutil apfs list`, delete it with `diskutil apfs deleteVolume \"{0}\"`")]
|
||||||
|
|
|
@ -200,6 +200,7 @@ fn fstab_entry(uuid: &Uuid, apfs_volume_label: &str) -> String {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
pub enum CreateFstabEntryError {
|
pub enum CreateFstabEntryError {
|
||||||
#[error("An `/etc/fstab` entry for the `/nix` path already exists, consider removing the entry for `/nix`d from `/etc/fstab`")]
|
#[error("An `/etc/fstab` entry for the `/nix` path already exists, consider removing the entry for `/nix`d from `/etc/fstab`")]
|
||||||
|
|
|
@ -88,6 +88,7 @@ impl Action for CreateSyntheticObjects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum CreateSyntheticObjectsError {
|
pub enum CreateSyntheticObjectsError {
|
||||||
#[error("Failed to execute command")]
|
#[error("Failed to execute command")]
|
||||||
|
|
|
@ -93,6 +93,7 @@ impl Action for EnableOwnership {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum EnableOwnershipError {
|
pub enum EnableOwnershipError {
|
||||||
#[error("Failed to execute command")]
|
#[error("Failed to execute command")]
|
||||||
|
|
|
@ -253,6 +253,7 @@ impl ActionDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error occurring during an action
|
/// An error occurring during an action
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(thiserror::Error, Debug, strum::IntoStaticStr)]
|
#[derive(thiserror::Error, Debug, strum::IntoStaticStr)]
|
||||||
pub enum ActionError {
|
pub enum ActionError {
|
||||||
/// A custom error
|
/// A custom error
|
||||||
|
|
|
@ -152,6 +152,7 @@ impl DiagnosticData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
pub enum DiagnosticError {
|
pub enum DiagnosticError {
|
||||||
#[error("Unknown url scheme")]
|
#[error("Unknown url scheme")]
|
||||||
|
|
|
@ -3,6 +3,7 @@ use std::path::PathBuf;
|
||||||
use crate::{action::ActionError, planner::PlannerError, settings::InstallSettingsError};
|
use crate::{action::ActionError, planner::PlannerError, settings::InstallSettingsError};
|
||||||
|
|
||||||
/// An error occurring during a call defined in this crate
|
/// An error occurring during a call defined in this crate
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(thiserror::Error, Debug, strum::IntoStaticStr)]
|
#[derive(thiserror::Error, Debug, strum::IntoStaticStr)]
|
||||||
pub enum NixInstallerError {
|
pub enum NixInstallerError {
|
||||||
/// An error originating from an [`Action`](crate::action::Action)
|
/// An error originating from an [`Action`](crate::action::Action)
|
||||||
|
|
|
@ -270,6 +270,7 @@ impl BuiltinPlanner {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error originating from a [`Planner`]
|
/// An error originating from a [`Planner`]
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(thiserror::Error, Debug, strum::IntoStaticStr)]
|
#[derive(thiserror::Error, Debug, strum::IntoStaticStr)]
|
||||||
pub enum PlannerError {
|
pub enum PlannerError {
|
||||||
/// `nix-installer` does not have a default planner for the target architecture right now
|
/// `nix-installer` does not have a default planner for the target architecture right now
|
||||||
|
|
|
@ -269,8 +269,9 @@ impl Into<BuiltinPlanner> for SteamDeck {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
enum SteamDeckError {
|
pub enum SteamDeckError {
|
||||||
#[error("`{0}` is not a path that can be canonicalized into an absolute path, bind mounts require an absolute path")]
|
#[error("`{0}` is not a path that can be canonicalized into an absolute path, bind mounts require an absolute path")]
|
||||||
AbsolutePathRequired(PathBuf),
|
AbsolutePathRequired(PathBuf),
|
||||||
}
|
}
|
||||||
|
|
|
@ -561,6 +561,7 @@ impl InitSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An error originating from a [`Planner::settings`](crate::planner::Planner::settings)
|
/// An error originating from a [`Planner::settings`](crate::planner::Planner::settings)
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
pub enum InstallSettingsError {
|
pub enum InstallSettingsError {
|
||||||
/// `nix-installer` does not support the architecture right now
|
/// `nix-installer` does not support the architecture right now
|
||||||
|
|
Loading…
Reference in a new issue