Lucky
TTCTheo's Typesafe Cult
•Created by johnny the fifth on 11/29/2024 in #questions
which approach is better for handling errors in my app
In general, reserve throwing errors for cases that are truly exceptional or need to be handled by the application as a whole, like server issues or unhandled conditions, while for validation or business logic checks (like friend requests), returning an object with a success flag and message is typically more appropriate.
4 replies