Time for #DEVDiscuss — right here on DEV 😎

Complementing exceptions - Introducing monads for error handling in ruby
Cherry Ramatis ・ Aug 13 '23
Inspired by @cherryramatis' Top 7 post, tonight’s topic is... Error Handling!
Effective API design is essential for creating user-friendly, efficient, and maintainable software systems. Idempotency is just one aspect, so what elements of API design are most crucial to you and your team?
Questions:
- How do you educate and onboard new developers on the error handling practices and conventions used in your projects?
- Are there any specific programming languages or frameworks that you believe excel in terms of providing comprehensive error handling mechanisms? Why?
- As projects scale, error management becomes more complex. What tools or practices do you recommend for effective error tracking and monitoring in large-scale applications?
- Any triumphs, fails, or other stories you'd like to share on this topic?
Top comments (1)
In answering the question:
How do you educate and onboard new developers on the error handling practices and conventions used in your projects?
A: Emphasize the importance of using
console.log()
,error_log()
orprint()/printf()
etc.. statements instead of debugging when debug is non available or leads to more problems.Using breakpoints may not always be necessary to detect errors and have them use their logic first to write more flexible code instead of adding up to massive blocks of try catch and ErrorHandling Utility classes. If errors need to be handled, try-catch with finally blocks are the standard way to go.