diff --git a/examples/api/src/views/Opener.svelte b/examples/api/src/views/Opener.svelte index 83e88073e..eca634ace 100644 --- a/examples/api/src/views/Opener.svelte +++ b/examples/api/src/views/Opener.svelte @@ -4,22 +4,20 @@ export let onMessage let url = '' - let path = '' - let revealPath = '' - - let urlProgram = 'Default' - let pathProgram = 'Default' - + let urlProgram = '' function openUrl() { opener.openUrl(url, urlProgram ? urlProgram : undefined).catch(onMessage) } + let path = '' + let pathProgram = '' function openPath() { opener .openPath(path, pathProgram ? pathProgram : undefined) .catch(onMessage) } + let revealPath = '' function revealItemInDir() { opener.revealItemInDir(revealPath).catch(onMessage) } diff --git a/plugins/opener/src/error.rs b/plugins/opener/src/error.rs index 231e48664..157922fc6 100644 --- a/plugins/opener/src/error.rs +++ b/plugins/opener/src/error.rs @@ -20,9 +20,9 @@ pub enum Error { Json(#[from] serde_json::Error), #[error("unknown program {0}")] UnknownProgramName(String), - #[error("Not allowed to open path {0}{}", .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())] + #[error("Not allowed to open path {}{}", .path, .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())] ForbiddenPath { path: String, with: Option }, - #[error("Not allowed to open url {0}{}", .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())] + #[error("Not allowed to open url {}{}", .url, .with.as_ref().map(|w| format!(" with {w}")).unwrap_or_default())] ForbiddenUrl { url: String, with: Option }, #[error("API not supported on the current platform")] UnsupportedPlatform,