Skip to main content

smbcloud_deploy/
error.rs

1use thiserror::Error;
2
3/// Errors surfaced by the deploy engine.
4///
5/// These are transport- and UI-neutral: a front-end decides how to render them
6/// (a red spinner line in the CLI, a failed CI step, a git sideband error).
7#[derive(Debug, Error)]
8pub enum DeployError {
9    /// No `.smb/config.toml` in the working directory. The front-end owns the
10    /// interactive setup flow, so the engine reports this rather than prompting.
11    #[error("no .smb/config.toml found; run setup first")]
12    NeedsSetup,
13
14    /// Couldn't determine the runtime from the working directory.
15    #[error(
16        "could not detect a runner: no package.json, Gemfile, Package.swift, or Cargo.toml found"
17    )]
18    RunnerNotDetected,
19
20    /// Anything not yet modelled as a specific variant.
21    #[error(transparent)]
22    Other(#[from] anyhow::Error),
23}