-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patherror.rs
52 lines (49 loc) · 1.62 KB
/
error.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// Copyright 2022 Oxide Computer Company
use std::{ffi, io, str};
use thiserror::Error;
/// Error conditions that can be emitted by Falcon
#[derive(Error, Debug)]
#[error("{0}")]
pub enum Error {
#[error("not implemented: {0}")]
NotImplemented(String),
#[error("not found: {0}")]
NotFound(String),
IO(#[from] io::Error),
Zone(#[from] zone::ZoneError),
FFI(#[from] ffi::NulError),
Utf8(#[from] str::Utf8Error),
FUtf8(#[from] std::string::FromUtf8Error),
#[error("exec: {0}")]
Exec(String),
QueryError(#[from] smf::QueryError),
#[error("path: {0}")]
PathError(String),
#[error("wrap: {0}")]
Wrap(String),
#[error("netadm: {0}")]
Libnet(#[from] libnet::Error),
#[error("cli: {0}")]
Cli(String),
#[error("exclusive iface used multiple times: {0}")]
ExternalNicReused(String),
RonSpan(#[from] ron::error::SpannedError),
Ron(#[from] ron::Error),
TomL(#[from] toml::ser::Error),
AddrParse(#[from] std::net::AddrParseError),
Propolis(#[from] propolis_client::Error),
PropolisTypes(
#[from] propolis_client::Error<propolis_client::types::Error>,
),
IntParse(#[from] std::num::ParseIntError),
TryIntParse(#[from] std::num::TryFromIntError),
WsError(#[from] tokio_tungstenite::tungstenite::Error),
Anyhow(#[from] anyhow::Error),
Uuid(#[from] uuid::Error),
#[error("no ports available")]
NoPorts,
Zfs(String),
}