mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-19 07:20:50 +01:00
polyfill for spa added. works now on android
This commit is contained in:
@ -12,6 +12,7 @@ pub enum ExtensionErrorCode {
|
||||
MutexPoisoned = 1003,
|
||||
Database = 2000,
|
||||
Filesystem = 2001,
|
||||
FilesystemWithPath = 2004,
|
||||
Http = 2002,
|
||||
Shell = 2003,
|
||||
Manifest = 3000,
|
||||
@ -60,6 +61,12 @@ pub enum ExtensionError {
|
||||
source: std::io::Error,
|
||||
},
|
||||
|
||||
#[error("Filesystem operation failed at '{path}': {source}")]
|
||||
FilesystemWithPath {
|
||||
path: String,
|
||||
source: std::io::Error,
|
||||
},
|
||||
|
||||
#[error("HTTP request failed: {reason}")]
|
||||
Http { reason: String },
|
||||
|
||||
@ -109,6 +116,7 @@ impl ExtensionError {
|
||||
ExtensionError::PermissionDenied { .. } => ExtensionErrorCode::PermissionDenied,
|
||||
ExtensionError::Database { .. } => ExtensionErrorCode::Database,
|
||||
ExtensionError::Filesystem { .. } => ExtensionErrorCode::Filesystem,
|
||||
ExtensionError::FilesystemWithPath { .. } => ExtensionErrorCode::FilesystemWithPath,
|
||||
ExtensionError::Http { .. } => ExtensionErrorCode::Http,
|
||||
ExtensionError::Shell { .. } => ExtensionErrorCode::Shell,
|
||||
ExtensionError::ManifestError { .. } => ExtensionErrorCode::Manifest,
|
||||
@ -146,6 +154,14 @@ impl ExtensionError {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Helper to create a filesystem error with path context
|
||||
pub fn filesystem_with_path<P: Into<String>>(path: P, source: std::io::Error) -> Self {
|
||||
Self::FilesystemWithPath {
|
||||
path: path.into(),
|
||||
source,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl serde::Serialize for ExtensionError {
|
||||
|
||||
Reference in New Issue
Block a user