polyfill for spa added. works now on android

This commit is contained in:
2025-10-09 11:16:25 +02:00
parent c8c3a5c73f
commit fa3348a5ad
35 changed files with 2566 additions and 373 deletions

View File

@ -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 {