Skip to content

Commit bad5fc6

Browse files
committed
improve permission denied error message
1 parent 2319dd9 commit bad5fc6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ async fn main() -> Result<()> {
4949
if e.to_string()
5050
.contains("org.freedesktop.DBus.Error.AccessDenied")
5151
{
52-
eprintln!("Permission Denied");
52+
eprintln!("Insufficient Permissions.");
53+
eprintln!(
54+
"You do not have the required permissions. Ensure you are part of the appropriate user group or use sudo."
55+
)
5356
} else {
5457
eprintln!("{}", e);
5558
}
@@ -95,7 +98,10 @@ async fn main() -> Result<()> {
9598
if e.to_string()
9699
.contains("org.freedesktop.DBus.Error.AccessDenied")
97100
{
98-
exit_error_message = Some(anyhow!("Permission Denied"));
101+
exit_error_message = Some(anyhow!("
102+
Insufficient Permissions.
103+
You do not have the required permissions. Ensure you are part of the appropriate user group or use sudo.
104+
"));
99105
} else {
100106
exit_error_message = Some(e);
101107
}

0 commit comments

Comments
 (0)