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

Explain why saving a screenshot might fail #2012

Merged

Conversation

Michael-F-Bryan
Copy link
Contributor

My ~/Pictures folder is located in a separate partition, and for whatever reason it was mounted in readonly mode. When I tried to save a screenshot, flameshot was just saying, "Error trying to save as /home/michael/Pictures/2021-10-27_12-56.png", without giving any real explanation for what went wrong.

I ended up scratching my head for a good 5-10 minutes trying to figure out why saving was failing when the folder exists and it has all the right permission. I only figured out what the issue was when I tried to create a file and touch gave me a more useful error message - "touch: cannot touch '/home/michael/Pictures/asdf': Read-only file system".

This PR modifies the way we save screenshots to write to a QFile and append file.errorString() to the error message if the save error was file-related.

@veracioux
Copy link
Contributor

@Michael-F-Bryan Thank you for your contribution. This will definitely prevent some issues from being reported repeatedly.

@veracioux veracioux merged commit 65f8ac0 into flameshot-org:master Oct 27, 2021
@Michael-F-Bryan Michael-F-Bryan deleted the improve-save-error-message branch October 27, 2021 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants