Skip to main content

brrr_lint/
error.rs

1//! Error types for the F* LSP server.
2
3use thiserror::Error;
4
5/// Main error type for the F* LSP server.
6#[derive(Error, Debug)]
7pub enum FstarError {
8    #[error("F* process error: {0}")]
9    Process(String),
10
11    #[error("F* process not found: {0}")]
12    FstarNotFound(String),
13
14    #[error("Protocol error: {0}")]
15    Protocol(String),
16
17    #[error("Configuration error: {0}")]
18    Config(String),
19
20    #[error("IO error: {0}")]
21    Io(#[from] std::io::Error),
22
23    #[error("JSON error: {0}")]
24    Json(#[from] serde_json::Error),
25
26    #[error("Query timeout after {0}ms")]
27    Timeout(u64),
28
29    #[error("Query cancelled")]
30    Cancelled,
31
32    #[error("Connection closed")]
33    ConnectionClosed,
34
35    #[error("Invalid position: line {line}, column {column}")]
36    InvalidPosition { line: u32, column: u32 },
37}
38
39pub type Result<T> = std::result::Result<T, FstarError>;