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

Expose io:Error from from_filepath #7

Open
alexanderkjall opened this issue Jan 1, 2022 · 1 comment
Open

Expose io:Error from from_filepath #7

alexanderkjall opened this issue Jan 1, 2022 · 1 comment

Comments

@alexanderkjall
Copy link

The from_filepath currently just swallows any errors that happens in regards to the file that was sent in as a parameter. This makes it hard to give the end user a good error message if something goes wrong.

Maybe consider to change this function from an Option to a Result?

This is how I used it now, and had to write a very generic error message: https://github.com/YaLTeR/wl-clipboard-rs/pull/16/files#diff-222c1b6ee536abb8fc978efb87e55b43402290cacf20cfa4a296e4373d1461c1R464

@mbrubeck
Copy link
Owner

I agree, from_filepath and related functions should return Result.

Patches are welcome, if someone else gets to this before I do.

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

No branches or pull requests

2 participants