mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-27 08:38:58 +00:00
ad1a489f75
Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
43 lines
1.3 KiB
Rust
43 lines
1.3 KiB
Rust
// Copyright 2024 RustFS Team
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
use thiserror::Error;
|
|
|
|
use crate::data_usage_define::DataUsageCache;
|
|
|
|
/// Scanner-related errors
|
|
#[derive(Error, Debug)]
|
|
#[non_exhaustive]
|
|
pub enum ScannerError {
|
|
/// Configuration error
|
|
#[error("Configuration error: {0}")]
|
|
Config(String),
|
|
|
|
/// I/O error
|
|
#[error("I/O error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
|
|
/// Serialization error
|
|
#[error("Serialization error: {0}")]
|
|
Serialization(#[from] serde_json::Error),
|
|
|
|
/// Generic error
|
|
#[error("Scanner error: {0}")]
|
|
Other(String),
|
|
|
|
/// Partial data usage cache produced before the scanner stopped.
|
|
#[error("Scanner stopped with partial data usage cache")]
|
|
PartialCache(Box<DataUsageCache>),
|
|
}
|