ecli_lib/
error.rs

1//!  SPDX-License-Identifier: MIT
2//!
3//! Copyright (c) 2023, eunomia-bpf
4//! All rights reserved.
5//!
6use std::io;
7
8#[derive(Debug, thiserror::Error)]
9pub enum Error {
10    #[error("Failed to perform IO operation")]
11    IOErr(io::Error),
12    #[error("Invalid param: {0}")]
13    InvalidParam(String),
14    #[error("Unknown suffix: {0}")]
15    UnknownSuffix(String),
16    #[error("Unknown filetype: {0}")]
17    UnknownFileType(String),
18    #[error("Error occurred when performing http operations: {0}")]
19    Http(String),
20    #[error("Bpf error: {0}")]
21    Bpf(String),
22    #[error("Wasm error: {0}")]
23    Wasm(String),
24    #[error("Failed to push oci image: {0}")]
25    OciPush(String),
26    #[error("Failed to pull oci image: {0}")]
27    OciPull(String),
28    #[error("Failed to serialize: {0}")]
29    Serialize(String),
30    #[error("Failed to login: {0}")]
31    Login(String),
32    #[error("Login info not found: {0}")]
33    LoginInfoNotFound(String),
34    #[error("Failed to join: {0}")]
35    ThreadJoin(String),
36    #[error("{0}")]
37    Tar(String),
38    #[error("Errors when logging: {0}")]
39    Log(String),
40    #[error("Failed to read: {0}")]
41    IORead(String),
42    #[error("{0}")]
43    Other(String),
44}
45
46pub type Result<T> = std::result::Result<T, Error>;