Skip to main content

rlqt_ui/
errors.rs

1// Copyright (C) 2025-2026 Michael S. Klishin and Contributors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use thiserror::Error;
16
17#[derive(Debug, Error)]
18pub enum ServerError {
19    #[error("Database error: {0}")]
20    Database(#[from] duckdb::Error),
21
22    #[error("Library error: {0}")]
23    Library(#[from] rlqt_lib::Error),
24
25    #[error("IO error: {0}")]
26    Io(#[from] std::io::Error),
27
28    #[error("Serialization error: {0}")]
29    Serialization(#[from] serde_json::Error),
30
31    #[error("Invalid datetime format: {0}")]
32    DateTimeParse(String),
33
34    #[error("Invalid preset: {0}")]
35    InvalidPreset(String),
36
37    #[error("Invalid query: {0}")]
38    InvalidQuery(String),
39}