Handle EBUSY as well

This commit is contained in:
Kovid Goyal 2022-12-06 12:20:20 +05:30
parent a3ba8647ba
commit 94410f2866
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 0 deletions

View File

@ -223,6 +223,8 @@ func error_from_status(status string) error {
return fmt.Errorf("no primary selection available on this system")
case "EPERM":
return fmt.Errorf("permission denied")
case "EBUSY":
return fmt.Errorf("a temporary error occurred, try again later.")
default:
return fmt.Errorf("%s", status)
}

View File

@ -102,6 +102,8 @@ func write_loop(inputs []*Input, opts *Options) (err error) {
return fmt.Errorf("Could not write to primary selection as the system does not support it")
case "EPERM":
return fmt.Errorf("Could not write to clipboard as permission was denied")
case "EBUSY":
return fmt.Errorf("Could not write to clipboard, a temporary error occurred, try again later.")
default:
return fmt.Errorf("Could not write to clipboard unknowns status returned from terminal: %#v", metadata["status"])
}