Samsung Interview Question
Software Engineer / DevelopersCountry: India
In what language? Can you give an example of an exception that's not caught by try-catch?
Yes, we can handle those exceptions which are not handled in try catch block.
We can handle the exception in app file.
All the errors which get escaped from catch block, handles in app file, here we can manage it according to our need. Thus preventing to be get crashed.
All exceptions end up in std::terminate() in the end.
- Simon Raybould March 26, 2013If your application MUST NOT crash (e.g. you are coding a safety critical system) then you would be wise to override std::terminate() by passing a pointer to your own exception handler to std::set_terminate().
Your handler should then take whatever action is appropriate to keep your system safe.