There is a precondition to talk about Exception.
" there is no right answer " // even guru programers has diffrent point of view
There are two method to manage an error or exception.
one is to use return value.
another is to jump to defined position.
using return value is not dangerous but we are easy to forget the treatment.
second thing is exception system in C++, JAVA, Python, C# etc..
exception system is very dangerous if you forget to manage them.
when one function throws some exceptions to caller method, if caller method don't treat that exception , your system will be shut down.
so,In Exception system, to make a pair like (begin, end) ( lock,unlock) (throw, catch) is very important.
JAVA provides checked exception system.
some group of exceptions are defined as checked exception,
that enforce you must write try~catch statement to manage exception well.
OK. good!! Java system make you free in dangerous situation.
but, why havn't other languages applied this good system ?
because it annoy and got bored programmers !!
if one function throws one more exception out, all system using that function treat about new exception!!
So, google c++ convention has below convention
" do not write c++ exception code in this legacy project"
that's telling us that making a pair of throw and catch is very very difficult.