28 ms·
Regardless of complexity: error messages, error messages, error messages. I can't emphasize enough how important decent error messages are. When you are having
by RedShift1 4y ago
Regardless of complexity: error messages, error messages, error messages. I can't emphasize enough how important decent error messages are. When you are having trouble with a file, include the full path in the error message. Put in the name of the function in the error message, what you expected and what you got. Bubble up lower level errors, don't swallow them. Include a stack trace, include the path of the log file if applicable. Please don't have your error message say "Something went wrong".
- enlyth 4y agoAgreed, a few times I've found myself in the unfortunate position of needing to push changes to production just to be able to diagnose an error, because it was being completely swallowed by a try-catch block with some generic "something went wrong" message.