vertigo-cli 0.13.1

Reactive Real-DOM library with SSR for Rust - packaging/serving tool
Documentation
use std::fmt::{self, Display};

/// Why a command failed, and the process exit code it becomes.
#[derive(Clone, Copy, Debug)]
#[repr(i32)]
pub enum ErrorCode {
    CantOpenWorkspace = 1,
    CantParseWorkspace = 2,
    CantFindCdylibMember = 3,
    PackageNameNotFound = 4,
    BuildFailed = 5,
    BuildPrerequisitesFailed = 6,
    WatcherError = 7,
    CantAddWatchDir = 8,
    OtherProcessAlreadyRunning = 9,
    CantReadWasmRunFromStatics = 10,
    CantReadStaticFile = 11,
    CantWriteOrRemoveFile = 12,
    CantSpawnChildProcess = 13,
    CouldntWaitForChildProcess = 14,
    WatchPipeBroken = 16,

    NewProjectDirNotEmpty = 17,
    NewProjectCantCreateDir = 18,
    NewProjectCantUnpackStub = 19,
    NewProjectCantCreateCargoToml = 20,
    NewProjectCantWriteToCargoToml = 21,

    ServeCantFindHttpBasePath = 22,
    ServeCantReadIndexFile = 23,
    ServeCantOpenPort = 24,
    ServeWasmReadFailed = 25,
    ServeWasmCompileFailed = 26,
    ServeWasmInstanceFailed = 27,
}

impl Display for ErrorCode {
    /// The variant name and its exit code.
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{self:?} (exit code {})", *self as i32)
    }
}

impl std::error::Error for ErrorCode {}