Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clipboard: add error handling based on clipboard::Error #1970

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

rzmk
Copy link
Collaborator

@rzmk rzmk commented Jul 14, 2024

Resolves #1969.

Comment on lines 43 to 45
arboard::Error::ClipboardNotSupported => CliError::Other(format!(
"The clipboard may not be supported for the current environment."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
Comment on lines 46 to 49
arboard::Error::ConversionFailure => CliError::Other(format!(
"The content that was about the be transferred to/from the clipboard could not be \
converted to the appropriate format."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
Comment on lines 50 to 53
arboard::Error::ClipboardOccupied => CliError::Other(format!(
"The clipboard was unaccessible when attempting to access/use it. It may have \
been held by another process/thread."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
Comment on lines 54 to 58
arboard::Error::ContentNotAvailable => CliError::Other(format!(
"The clipboard contents were not available in the requested format. This could \
either be due to the clipboard being empty or the clipboard contents having an \
incompatible format to the requested one."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
Comment on lines 59 to 61
arboard::Error::Unknown { description: _ } => CliError::Other(format!(
"An unknown error occurred while attempting to use the clipboard."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
Comment on lines 62 to 64
_ => CliError::Other(format!(
"An unexpected error occurred while using the clipboard."
)),

Check warning

Code scanning / clippy

useless use of format! Warning

useless use of format!
fn from(err: arboard::Error) -> Self {
match err {
arboard::Error::ClipboardNotSupported => {
CliError::Other("The clipboard may not be supported for the current environment.")

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
fn from(err: arboard::Error) -> Self {
match err {
arboard::Error::ClipboardNotSupported => {
CliError::Other("The clipboard may not be supported for the current environment.")

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
Comment on lines 47 to 48
"The content that was about the be transferred to/from the clipboard could not be \
converted to the appropriate format.",

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
arboard::Error::ClipboardNotSupported => {
CliError::Other("The clipboard may not be supported for the current environment.")
},
arboard::Error::ConversionFailure => CliError::Other(

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
Comment on lines 51 to 52
"The clipboard was unaccessible when attempting to access/use it. It may have \
been held by another process/thread.",

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
"The clipboard was unaccessible when attempting to access/use it. It may have \
been held by another process/thread.",
),
arboard::Error::ContentNotAvailable => CliError::Other(

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
incompatible format to the requested one.",
),
arboard::Error::Unknown { description: _ } => {
CliError::Other("An unknown error occurred while attempting to use the clipboard.")

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
incompatible format to the requested one.",
),
arboard::Error::Unknown { description: _ } => {
CliError::Other("An unknown error occurred while attempting to use the clipboard.")

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
arboard::Error::Unknown { description: _ } => {
CliError::Other("An unknown error occurred while attempting to use the clipboard.")
},
_ => CliError::Other("An unexpected error occurred while using the clipboard."),

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
arboard::Error::Unknown { description: _ } => {
CliError::Other("An unknown error occurred while attempting to use the clipboard.")
},
_ => CliError::Other("An unexpected error occurred while using the clipboard."),

Check failure

Code scanning / clippy

mismatched types Error

mismatched types
@jqnatividad jqnatividad merged commit d944e8d into master Jul 15, 2024
13 of 16 checks passed
@rzmk rzmk deleted the qsv-clipboard-fix branch August 7, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle .unwrap() in qsv clipboard
2 participants