generated from block/oss-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
There are 97 instances of .map_err(|e| e.to_string()) and another 14 of .map_err(|e| format!(...)) in lib.rs alone. This is the classic Tauri command error-handling pattern that can be cleaned up by:
Defining an AppError enum that implements Into (or just impl From for String via a wrapper)
Or using a type alias like type CmdResult = Result<T, String> with a blanket .map_err() trait extension
Tauri 2.x supports impl serde::Serialize for command errors — a custom error type with impl Fromanyhow::Error or Fromstore::Error would let you use ? directly
This would remove a huge amount of noise from every command handler.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels