Because LLMs mostly follow historical practice. And examples for bad error handling are more common (and easier) than good error handling.
I'm pretty sure an LLM will be able to handle an instruction such as:
"Wherever exceptions are thrown, add as much contextual information to the exceptions as possible. Use class RichException<Exception> to store the extra information". Etc. etc.
I'm pretty sure an LLM will be able to handle an instruction such as:
"Wherever exceptions are thrown, add as much contextual information to the exceptions as possible. Use class RichException<Exception> to store the extra information". Etc. etc.