mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
net: Treat SSL handshake errors differently from other hyper errors.
This commit is contained in:
parent
cb4e3cb16a
commit
b7a640b517
2 changed files with 9 additions and 4 deletions
|
@ -712,12 +712,17 @@ pub enum NetworkError {
|
|||
Internal(String),
|
||||
LoadCancelled,
|
||||
/// SSL validation error that has to be handled in the HTML parser
|
||||
SslValidation(ServoUrl, String),
|
||||
SslValidation(String),
|
||||
}
|
||||
|
||||
impl NetworkError {
|
||||
pub fn from_hyper_error(error: &HyperError) -> Self {
|
||||
NetworkError::Internal(error.to_string())
|
||||
let s = error.to_string();
|
||||
if s.contains("the handshake failed") {
|
||||
NetworkError::SslValidation(s)
|
||||
} else {
|
||||
NetworkError::Internal(s)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_http_error(error: &HttpError) -> Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue