D
D
Denis2016-04-26 14:41:37
C++ / C#
Denis, 2016-04-26 14:41:37

Is there a c++ universal exception format like in java?

Is there a generic exception in c++ that allows you to abstract from the type of exception being thrown, like in java?
Example:

try
{
throw // любое исключение
}catch(Exception  er)
{
....
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maaGames, 2016-04-26
@lacredin

You can intercept almost everything, but there will be no additional data. Or catch several types of exceptions in turn. Plus there are structural exceptions that catch will not catch.

try
{
}
catch( std::exception & e )
{
    // только тип std::exception
}
catch(...)
{
  // все прочие типы
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question