Hacker News new | ask | show | jobs
by gf000 63 days ago
grep "caused by"

Here you are.

2 comments

Why not just make your errors more readable and not have to use an extra tool?
Well, just write more readable error messages?

How do you make this more readable:

ExceptionName: Dev-given message at Class(line number) at Class(line number) caused by AnotherCauseException: Dev-given message at Class(line number)

It's only the dev given message that may or may not be of good quality, the exact same way as it is in go. It's a plus that you can't accidentally ignore error cases, and even if a dev was lazy, you still have a pretty good record for where a given error case could originate from.

Again, I am a sysadmin, not a developer. Telling me line numbers in a files written in a language I don't understand is not helpful. I don't care where the error occurred in the code. I care what the error was so I can hopefully fix it, assuming its external and not a bug in the code.
Don't have to grep my go errors :)
Especially when they forget to properly handle an error case among the litany of if err line noise, and you get erroneous code execution with no record of it!