Hacker News new | ask | show | jobs
by shooly 16 hours ago
Absolutely not.

It's good to inform users why something failed, even if they can't do anything about it. For example, if a post was just removed, it's better to show "Failed to like: the post no longer exists" instead of a generic "Failed to like". Otherwise, the user will just keep trying to like the post again, and again, without understanding why it doesn't work.

I'm not even going to waste my time commenting on that "security perspective" part of your comment. What an insane take.

1 comments

> For example, if a post was just removed, it's better to show "Failed to like: the post no longer exists"

Why does your UI provide a like button for a removed post in the first place?

I mean, I get it, it could be a stale view you're interacting with; and yes, your error message is better than a generic one. But that doesn't mean you're exposing all error details to the user, you're just providing better error responses.

I guess the misunderstanding is coming from the "actual error" not being clearly defined.

P.S. The stale view can be solved by having live updating pages using SSE like the CQRS architecture that https://data-star.dev promotes. But if you're dealing with eventual consistency on a big scale then yes, it might not be solvable and better error messages is the best you can do.