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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do Not Merge] display more errors #22

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Freyert
Copy link

@Freyert Freyert commented Oct 22, 2023

@terhechte thank you so much for building a mastodon client in Rust!

I'm very interested in using Ebou and contributing to the project.

As an Arch Linux/Wayland user I discovered a number of items that don't "work out of the box". Digging into them some were easy to solve, and some like wayland clipboard support were not.

Because many of the errors were "thrown away" it was a bit more challenging to discover what was going on.

馃憠 I would like to expose more of these errors to users to help folks troubleshoot these issues. I'm not entirely sure how to easily expose these errors to the client, so I thought I would open a PR while I try to figure it out in case there's a system you're using.

In general it comes down to changing the view_store or the state error_message. If you assign the error_message to None no error message will display.

state.error_message = do_thing.map_or_else(
//error
|| Some(format!("error message"),
 //success
 |_| None)

if let Ok(mut ctx) = copypasta::ClipboardContext::new() {
let _ = ctx.set_contents(url);
}
_ = match copypasta::ClipboardContext::new() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to figure out how to set the view_store.error_message.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! You'd define a new item on the Action enum for the Login and then send it with the error message, like so:

https://github.com/terhechte/Ebou/blob/main/src/components/conversation/view.rs#L80

If the Error Message can't be cloned and can't be send you could format it into a string first

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.

None yet

2 participants