Files
luxe/crates/luxe-dap/src/tool/failure.rs
Evan Whittaker 09a7de2520 Initial public release
Luxe 0.1.0: a coding agent harness for the terminal. See README.md to get started and CHANGELOG.md for releases.
2026-10-17 12:08:30 -05:00

39 lines
925 B
Rust

//! Failure — why a `debug` call produced no answer.
use crate::client::DapError;
/// Why a `debug` call produced no answer.
pub(super) enum Failure {
/// The call was wrong: a missing argument, an unknown action, a session that is gone
Usage(String),
/// The debugger said no
Dap(DapError),
}
impl std::fmt::Display for Failure {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Usage(message) => formatter.write_str(message),
Self::Dap(error) => error.fmt(formatter),
}
}
}
impl From<String> for Failure {
fn from(message: String) -> Self {
Self::Usage(message)
}
}
impl From<&str> for Failure {
fn from(message: &str) -> Self {
Self::Usage(message.to_string())
}
}
impl From<DapError> for Failure {
fn from(error: DapError) -> Self {
Self::Dap(error)
}
}