2019-03-13 12:40:11 -07:00
|
|
|
use std::io;
|
|
|
|
|
2021-01-22 17:33:50 -08:00
|
|
|
use derive_more::Display;
|
2019-03-13 12:40:11 -07:00
|
|
|
|
2021-01-22 17:33:50 -08:00
|
|
|
#[derive(Debug, Display)]
|
2019-03-13 12:40:11 -07:00
|
|
|
pub enum ConnectError {
|
|
|
|
/// Failed to resolve the hostname
|
|
|
|
#[display(fmt = "Failed resolving hostname: {}", _0)]
|
2021-01-22 17:33:50 -08:00
|
|
|
Resolver(Box<dyn std::error::Error>),
|
2019-03-13 12:40:11 -07:00
|
|
|
|
|
|
|
/// No dns records
|
|
|
|
#[display(fmt = "No dns records found for the input")]
|
|
|
|
NoRecords,
|
|
|
|
|
|
|
|
/// Invalid input
|
|
|
|
InvalidInput,
|
|
|
|
|
|
|
|
/// Unresolved host name
|
|
|
|
#[display(fmt = "Connector received `Connect` method with unresolved host")]
|
2020-05-03 23:14:22 +01:00
|
|
|
Unresolved,
|
2019-03-13 12:40:11 -07:00
|
|
|
|
2020-09-02 22:14:07 +01:00
|
|
|
/// Connection IO error
|
2019-03-13 12:40:11 -07:00
|
|
|
#[display(fmt = "{}", _0)]
|
2019-03-13 14:38:33 -07:00
|
|
|
Io(io::Error),
|
2019-03-13 12:40:11 -07:00
|
|
|
}
|