After TRY and CATCH was introduced the "Unknown System Error" prompt to the user became commonplace . A calls B calls C. C throws a message, developer of B was needed to finish his increment/ was lazy/ couldn't care less and is not handling the error, and developer of A never foresaw the error because he never ever heard about C. Now he just pushes the whole mess back to the user.
Who is responsible? No one knows, somewhere in the code mess someone threw an error, and no one cared about handling it. That's all we know.
Errors/Exception should be handled locally where they occur. Not praying that someone should care about it. No one knows where the code is which handles the error.
Thanks for the comment! That seems to be the problem with work ethics / qualifications of developer B rather than with exceptions themselves. I've seen the damage people like that can do but we can only do so much to design our code around morons.
The fact that exception classes can carry additional information with them is a step up compared with FMs and routines of the last century's ABAP. "Unknown error" happens when developers are unaware of this, which was the point of my story. You don't need to know where exactly exception happened. That's the whole idea.
Responsibility should be clear from the method design? Am I the method that updates DB or am I the method that serves messages to the user/consumer? I feel this comment rather proves my point. :) People are using exceptions wrong.
Oh no, please not "TRIAL" and "ERROR".
After TRY and CATCH was introduced the "Unknown System Error" prompt to the user became commonplace . A calls B calls C. C throws a message, developer of B was needed to finish his increment/ was lazy/ couldn't care less and is not handling the error, and developer of A never foresaw the error because he never ever heard about C. Now he just pushes the whole mess back to the user.
Who is responsible? No one knows, somewhere in the code mess someone threw an error, and no one cared about handling it. That's all we know.
Errors/Exception should be handled locally where they occur. Not praying that someone should care about it. No one knows where the code is which handles the error.
Spaghetti coding.
Thanks for the comment! That seems to be the problem with work ethics / qualifications of developer B rather than with exceptions themselves. I've seen the damage people like that can do but we can only do so much to design our code around morons.
The fact that exception classes can carry additional information with them is a step up compared with FMs and routines of the last century's ABAP. "Unknown error" happens when developers are unaware of this, which was the point of my story. You don't need to know where exactly exception happened. That's the whole idea.
Responsibility should be clear from the method design? Am I the method that updates DB or am I the method that serves messages to the user/consumer? I feel this comment rather proves my point. :) People are using exceptions wrong.