Skip to main content

rustfs_tls_runtime/
error.rs

1// Copyright 2024 RustFS Team
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 std::path::PathBuf;
16use thiserror::Error;
17
18#[derive(Debug, Error)]
19pub enum TlsRuntimeError {
20    #[error("TLS source path is empty")]
21    EmptySourcePath,
22    #[error("TLS directory does not exist: {path}")]
23    DirectoryNotFound { path: PathBuf },
24    #[error("TLS path is not a directory: {path}")]
25    NotADirectory { path: PathBuf },
26    #[error("TLS material error: {0}")]
27    Material(String),
28    #[error("TLS publication error: {0}")]
29    Publication(String),
30    #[error("I/O error: {0}")]
31    Io(#[from] std::io::Error),
32}