mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Debug Implementation for NetworkError
Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
This commit is contained in:
parent
1b396e535f
commit
545364c636
1 changed files with 3 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
||||||
#![deny(unsafe_code)]
|
#![deny(unsafe_code)]
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt::{Debug, Display, Formatter};
|
use std::fmt::{self, Debug, Display};
|
||||||
use std::sync::{LazyLock, OnceLock};
|
use std::sync::{LazyLock, OnceLock};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -924,7 +924,7 @@ pub enum CookieSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Network errors that have to be exported out of the loaders
|
/// Network errors that have to be exported out of the loaders
|
||||||
#[derive(Clone, Debug, Deserialize, Eq, MallocSizeOf, PartialEq, Serialize)]
|
#[derive(Clone, Deserialize, Eq, MallocSizeOf, PartialEq, Serialize)]
|
||||||
pub enum NetworkError {
|
pub enum NetworkError {
|
||||||
/// Could be any of the internal errors, like unsupported scheme, connection errors, etc.
|
/// Could be any of the internal errors, like unsupported scheme, connection errors, etc.
|
||||||
Internal(String),
|
Internal(String),
|
||||||
|
@ -959,6 +959,7 @@ pub enum NetworkError {
|
||||||
impl fmt::Debug for NetworkError {
|
impl fmt::Debug for NetworkError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
NetworkError::Internal(s) => write!(f, "{}", s),
|
||||||
NetworkError::UnsupportedScheme => write!(f, "Unsupported scheme"),
|
NetworkError::UnsupportedScheme => write!(f, "Unsupported scheme"),
|
||||||
NetworkError::CorsGeneral => write!(f, "CORS check failed"),
|
NetworkError::CorsGeneral => write!(f, "CORS check failed"),
|
||||||
NetworkError::CrossOriginResponse => write!(f, "Cross-origin response"),
|
NetworkError::CrossOriginResponse => write!(f, "Cross-origin response"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue