Download packages/tauri-plugins/plugins/http/src/error.rs from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 1.8 kB
-
https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri-plugins/plugins/http/src/error.rs
- Command line
-
hf download hf://datasets/echodict/readest/packages/tauri-plugins/plugins/http/src/error.rs
-
curl -L -o error.rs https://huggingface.co/datasets/echodict/readest/resolve/main/packages/tauri-plugins/plugins/http/src/error.rs
1.8 kB
| // Copyright 2019-2023 Tauri Programme within The Commons Conservancy | |
| // SPDX-License-Identifier: Apache-2.0 | |
| // SPDX-License-Identifier: MIT | |
| use serde::{Serialize, Serializer}; | |
| use url::Url; | |
| pub enum Error { | |
| Json( serde_json::Error), | |
| Io( std::io::Error), | |
| Network( reqwest::Error), | |
| Http( http::Error), | |
| HttpInvalidHeaderName( http::header::InvalidHeaderName), | |
| HttpInvalidHeaderValue( http::header::InvalidHeaderValue), | |
| /// URL not allowed by the scope. | |
| UrlNotAllowed(Url), | |
| UrlParseError( url::ParseError), | |
| /// HTTP method error. | |
| HttpMethod( http::method::InvalidMethod), | |
| SchemeNotSupport(String), | |
| RequestCanceled, | |
| FsError( tauri_plugin_fs::Error), | |
| DataUrlError, | |
| DataUrlDecodeError, | |
| Tauri( tauri::Error), | |
| Utf8( std::string::FromUtf8Error), | |
| DangerousSettings, | |
| } | |
| impl Serialize for Error { | |
| fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error> | |
| where | |
| S: Serializer, | |
| { | |
| serializer.serialize_str(self.to_string().as_ref()) | |
| } | |
| } | |
| pub type Result<T> = std::result::Result<T, Error>; | |