In the case of reducing the exception, it is safe to deal with exceptions. Then should I make an exception by using all those blocks as a try-catch? Doesn't that make the code too messy?
c++ exception exception-handling try-catch
You do not need to make an exception for all blocks.
The method should only be caught when the exception can be handled properly. Exceptions that cannot be processed in the current method go up in the call stack and look for a method to handle them.
If you do this, the top level of the call stack logs unexpected errors You do not need to make an exception for all blocks.
© 2024 OneMinuteCode. All rights reserved.