lexa_framework/application/error.rs
1// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
2// ┃ Copyright: (c) 2023, Mike 'PhiSyX' S. (https://github.com/PhiSyX) ┃
3// ┃ SPDX-License-Identifier: MPL-2.0 ┃
4// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
5// ┃ ┃
6// ┃ This Source Code Form is subject to the terms of the Mozilla Public ┃
7// ┃ License, v. 2.0. If a copy of the MPL was not distributed with this ┃
8// ┃ file, You can obtain one at https://mozilla.org/MPL/2.0/. ┃
9// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
10
11// ----------- //
12// Énumération //
13// ----------- //
14
15#[derive(Debug)]
16#[derive(thiserror::Error)]
17#[error("\n\t[{}]: {0}", std::any::type_name::<Self>())]
18pub enum Error {
19 IO(#[from] std::io::Error),
20 Log(#[from] log::SetLoggerError),
21 LexaDatabase(#[from] lexa_database::Error),
22 LexaEnv(#[from] lexa_env::Error),
23 Server(#[from] crate::server::Error),
24}
25
26#[derive(Debug)]
27#[derive(thiserror::Error)]
28#[error("\n\t[{}]: {0}", std::any::type_name::<Self>())]
29pub enum ServiceError {
30 BoxedSend(Box<dyn std::error::Error + Send + Sync>),
31 Boxed(Box<dyn std::error::Error>),
32 IO(std::io::Error),
33 LexaDatabase(#[from] lexa_database::Error),
34}