Files
foxhunt/fxt/src/error.rs
jgrusewski 2da5bafc0e refactor: rename tli→fxt, delete legacy scripts/RunPod/deploy artifacts
- Rename tli/ directory to fxt/, update package + binary name to "fxt"
- Replace all `use tli::` → `use fxt::` across 52 Rust files
- Update build.rs proto paths (tli/proto → fxt/proto) in 6 services
- Update Dockerfiles, CI workflows, deploy.sh for new paths
- Delete ~170 legacy shell scripts (kept 15 essential ones)
- Delete RunPod Python client (runpod/), tests (tests/runpod/)
- Delete foxhunt-deploy crate (RunPod-only deployment tool)
- Delete terraform/runpod/ (moved to Scaleway)
- Delete ML Python hyperopt scripts (replaced by Rust Argmin PSO)
- Delete .gitlab-ci.yml (using GitHub + Gitea)
- Remove foxhunt-deploy from workspace members

504 files changed, -74,355 lines of legacy code removed.
Workspace compiles clean (0 errors, 0 warnings).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:32:21 +01:00

88 lines
3.1 KiB
Rust

//! Error types for TLI
use thiserror::Error;
/// Comprehensive error type for TLI operations
///
/// Represents all possible errors that can occur in the TLI client system,
/// including network connectivity, configuration, validation, and protocol errors.
#[derive(Error, Debug)]
pub enum TliError {
/// Network connection or gRPC transport errors
///
/// Occurs when unable to establish or maintain connections to trading services,
/// including network timeouts, DNS resolution failures, and connection drops.
#[error("Connection error: {0}")]
Connection(String),
/// Configuration loading or validation errors
///
/// Occurs when configuration files are malformed, missing required fields,
/// or contain invalid values that prevent proper system initialization.
#[error("Configuration error: {0}")]
Config(String),
/// Dashboard rendering or UI component errors
///
/// Occurs when terminal UI components fail to render, update, or handle
/// user input properly in the TLI dashboard interface.
#[error("Dashboard error: {0}")]
Dashboard(String),
/// File system or general I/O operation errors
///
/// Covers file read/write failures, permission errors, and other
/// input/output operations that fail at the system level.
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
/// gRPC protocol or service communication errors
///
/// Represents errors from gRPC calls including service unavailable,
/// authentication failures, timeout errors, and malformed responses.
#[error("gRPC error: {0}")]
Grpc(#[from] tonic::Status),
/// Invalid request parameters or data validation errors
///
/// Occurs when client requests contain invalid data such as negative
/// quantities, malformed orders, or parameters that fail validation.
#[error("Invalid request: {0}")]
InvalidRequest(String),
/// Resource not found errors
///
/// Occurs when requested resources such as orders, positions, or
/// configurations cannot be located in the system.
#[error("Not found: {0}")]
NotFound(String),
/// Buffer overflow or capacity limit errors
///
/// Occurs when internal buffers for events, metrics, or data streams
/// reach capacity limits and cannot accept additional data.
#[error("Buffer full: {0}")]
BufferFull(String),
/// Trading symbol validation errors
///
/// Occurs when trading symbols fail format validation, contain invalid
/// characters, or exceed length limits for the trading system.
#[error("Invalid symbol: {0}")]
InvalidSymbol(String),
/// Catch-all for unexpected or unclassified errors
///
/// Used for errors that don't fit into other categories or represent
/// unexpected system states that require investigation.
#[error("Other error: {0}")]
Other(String),
}
/// Result type alias for TLI operations
///
/// Standard Result type using `TliError` as the error variant.
///
/// Used throughout the TLI codebase for consistent error handling.
pub type TliResult<T> = Result<T, TliError>;