1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-02-12 21:25:31 +01:00

31 lines
741 B
Rust
Raw Normal View History

2019-03-13 12:40:11 -07:00
use std::io;
use derive_more::{Display, From};
use trust_dns_resolver::error::ResolveError;
#[derive(Debug, From, Display)]
pub enum ConnectError {
/// Failed to resolve the hostname
#[display(fmt = "Failed resolving hostname: {}", _0)]
Resolver(ResolveError),
/// No dns records
#[display(fmt = "No dns records found for the input")]
NoRecords,
/// Connecting took too long
#[display(fmt = "Timeout out while establishing connection")]
Timeout,
/// Invalid input
InvalidInput,
/// Unresolved host name
#[display(fmt = "Connector received `Connect` method with unresolved host")]
Unresolverd,
/// Connection io error
#[display(fmt = "{}", _0)]
IoError(io::Error),
}