mirror of
https://github.com/tauri-apps/tauri.git
synced 2025-01-01 23:42:33 +03:00
feat(core): add error message on error::CreateWebview
(#1602)
This commit is contained in:
parent
1e0b41e155
commit
7471e347d3
5
.changes/create-webview-error.md
Normal file
5
.changes/create-webview-error.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
`tauri::error::CreateWebview` now has the error string message attached.
|
@ -8,8 +8,8 @@ use std::path::PathBuf;
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
/// Failed to create webview.
|
||||
#[error("failed to create webview")]
|
||||
CreateWebview,
|
||||
#[error("failed to create webview: {0}")]
|
||||
CreateWebview(String),
|
||||
/// Failed to create window.
|
||||
#[error("failed to create window")]
|
||||
CreateWindow,
|
||||
|
@ -292,7 +292,7 @@ impl Dispatch for WryDispatcher {
|
||||
custom_protocols.into_iter().map(|(_, p)| p).collect(),
|
||||
file_drop_handler,
|
||||
)
|
||||
.map_err(|_| crate::Error::CreateWebview)?;
|
||||
.map_err(|e| crate::Error::CreateWebview(e.to_string()))?;
|
||||
|
||||
let dispatcher = WryDispatcher {
|
||||
window,
|
||||
@ -466,7 +466,7 @@ impl Runtime for Wry {
|
||||
type Dispatcher = WryDispatcher;
|
||||
|
||||
fn new() -> crate::Result<Self> {
|
||||
let app = wry::Application::new().map_err(|_| crate::Error::CreateWebview)?;
|
||||
let app = wry::Application::new().map_err(|e| crate::Error::CreateWebview(e.to_string()))?;
|
||||
Ok(Self { inner: app })
|
||||
}
|
||||
|
||||
@ -506,7 +506,7 @@ impl Runtime for Wry {
|
||||
custom_protocols.into_iter().map(|(_, p)| p).collect(),
|
||||
file_drop_handler,
|
||||
)
|
||||
.map_err(|_| crate::Error::CreateWebview)?;
|
||||
.map_err(|e| crate::Error::CreateWebview(e.to_string()))?;
|
||||
|
||||
let dispatcher = WryDispatcher {
|
||||
window,
|
||||
|
Loading…
Reference in New Issue
Block a user