Try Catch blocks inside or outside of functions and error handing -


This is a more general purpose programming question than a language specific. I have seen many performances for trying and catching.

Whatever process you need to preprocess, call a function with appropriate arguments and wrap it in an attempt / catch block.

The second thing is that to pass data to a function and rely on the attempt to capture within the function, if a true / false flag is returned in case of errors.

There is a combination with the third attempt to hold out of the ceremony and inside. However, if the function tries to catch something, then it catches another exception to the catch block outside the function to capture it.

Any ideas / standards are accepted on the professionals / ideas of these methods for error control? My Googling Ninja skills have failed me to find exact data on this.

In general, an exception can only be caught if it can actually be handled

There is no point in catching the exceptions for any other purpose than logging in. The exception is that the exception should be caught at the "top level" so that it can be logged. All other codes should allow exceptions to the promotion of code that will log them.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -