dfw/
errors.rs

1// Copyright Pit Kleyersburg <pitkley@googlemail.com>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3//
4// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7// option. This file may not be copied, modified or distributed
8// except according to those terms.
9
10//! Errors, using [`failure`][failure].
11//!
12//! [failure]: https://crates.io/crates/failure
13
14#![allow(missing_docs)]
15
16use failure::{Error, Fail};
17
18#[derive(Debug, Fail)]
19pub enum DFWError {
20    #[fail(display = "NFTables error: \n{}\n{}", stdout, stderr)]
21    NFTablesError { stdout: String, stderr: String },
22    #[fail(display = "trait method unimplemented: {}", method)]
23    TraitMethodUnimplemented { method: String },
24}
25
26pub type Result<E> = ::std::result::Result<E, Error>;