Better errors

This commit is contained in:
Gregory 2020-06-10 14:14:32 -04:00
parent 31bc3e3370
commit e33f52cbb5
No known key found for this signature in database
GPG key ID: 2E44FAEEDC94B1E2
3 changed files with 34 additions and 35 deletions

64
Cargo.lock generated
View file

@ -181,8 +181,8 @@ dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
]
[[package]]
@ -956,8 +956,8 @@ dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
]
[[package]]
@ -987,8 +987,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10b4b44893d3c370407a1d6a5cfde7c41ae0478e31c516c85f67eb3adc51be6d"
dependencies = [
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
]
[[package]]
@ -1023,8 +1023,8 @@ checksum = "18f33027081eba0a6d8aba6d1b1c3a3be58cbb12106341c2d5759fcd9b5277e7"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
"version_check",
]
@ -1035,8 +1035,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de"
dependencies = [
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
"syn-mid",
"version_check",
]
@ -1058,9 +1058,9 @@ checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
[[package]]
name = "quote"
version = "1.0.6"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea"
checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
dependencies = [
"proc-macro2",
]
@ -1273,15 +1273,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f2c3ac8e6ca1e9c80b8be1023940162bf81ae3cffbb1809474152f2ce1eb250"
dependencies = [
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
]
[[package]]
name = "serde_json"
version = "1.0.53"
version = "1.0.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "993948e75b189211a9b31a7528f950c6adc21f9720b6438ff80a7fa2f864cea2"
checksum = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226"
dependencies = [
"itoa",
"ryu",
@ -1383,12 +1383,12 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.30"
version = "1.0.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93a56fabc59dce20fe48b6c832cc249c713e7ed88fa28b0ee0a3bfcaae5fe4e2"
checksum = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6"
dependencies = [
"proc-macro2",
"quote 1.0.6",
"quote 1.0.7",
"unicode-xid 0.2.0",
]
@ -1399,8 +1399,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a"
dependencies = [
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
]
[[package]]
@ -1460,8 +1460,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "893582086c2f98cde18f906265a65b5030a074b1046c674ae898be6519a7f479"
dependencies = [
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
]
[[package]]
@ -1500,8 +1500,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389"
dependencies = [
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
]
[[package]]
@ -1625,9 +1625,9 @@ dependencies = [
[[package]]
name = "vcpkg"
version = "0.2.9"
version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55d1e41d56121e07f1e223db0a4def204e45c85425f6a16d462fd07c8d10d74c"
checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
[[package]]
name = "vec_map"
@ -1679,8 +1679,8 @@ dependencies = [
"lazy_static",
"log",
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
"wasm-bindgen-shared",
]
@ -1702,7 +1702,7 @@ version = "0.2.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "838e423688dac18d73e31edce74ddfac468e37b1506ad163ffaf0a46f703ffe3"
dependencies = [
"quote 1.0.6",
"quote 1.0.7",
"wasm-bindgen-macro-support",
]
@ -1713,8 +1713,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92"
dependencies = [
"proc-macro2",
"quote 1.0.6",
"syn 1.0.30",
"quote 1.0.7",
"syn 1.0.31",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]

View file

@ -43,7 +43,6 @@ impl DesktopEntry {
}
fn exec_inner(&self, arg: Vec<String>) -> Result<()> {
let (cmd, args) = self.get_cmd(arg)?;
dbg!(&cmd, &args);
let mut cmd = Command::new(cmd);
cmd.args(args);
if self.term {

View file

@ -10,13 +10,13 @@ pub enum Error {
Xdg(#[from] xdg::BaseDirectoriesError),
#[error(transparent)]
Config(#[from] confy::ConfyError),
#[error("no handler defined for this mime/extension")]
#[error("no handler defined for .{0}")]
NotFound(String),
#[error("could not figure out the mime type .{0}")]
Ambiguous(String),
#[error(transparent)]
BadMimeType(#[from] mime::FromStrError),
#[error("Malformed desktop entry")]
#[error("Malformed desktop entry at .{0}")]
BadEntry(std::path::PathBuf),
}