Utility functions for exception handling. More...
Go to the source code of this file.
Namespaces | |
| namespace | Arcane |
| -- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -- | |
Functions | |
| Int32 | Arcane::ExceptionUtils::print (ITraceMng *tm, bool is_no_continue=true) |
| Prints a message for an unknown exception. | |
| Int32 | Arcane::ExceptionUtils::print (const std::exception &ex, ITraceMng *tm, bool is_no_continue=true) |
| Prints a message for the standard exception ex. | |
| Int32 | Arcane::ExceptionUtils::print (const Exception &ex, ITraceMng *tm, bool is_no_continue=true) |
| Prints a message for the standard exception ex. | |
| Int32 | Arcane::ExceptionUtils::callWithTryCatch (std::function< void()> function, ITraceMng *tm=nullptr) |
| Calls a function while catching and displaying exceptions. | |
| void | Arcane::ExceptionUtils::callAndTerminateIfThrow (std::function< void()> function, ITraceMng *tm=nullptr) |
| Calls a function and terminates the program if an exception occurs. | |
Utility functions for exception handling.
Definition in file ExceptionUtils.h.
| void Arcane::ExceptionUtils::callAndTerminateIfThrow | ( | std::function< void()> | function, |
| ITraceMng * | tm = nullptr ) |
Calls a function and terminates the program if an exception occurs.
Calls the function function via callWithTryCatch() and calls std::terminate() in case of an exception.
Definition at line 130 of file ExceptionUtils.cc.
| Int32 Arcane::ExceptionUtils::callWithTryCatch | ( | std::function< void()> | function, |
| ITraceMng * | tm = nullptr ) |
Calls a function while catching and displaying exceptions.
Executes the function function and catches any exceptions. In case of an exception, the print() function is called to display a message, and the return code is that of the print() function.
Usage:
Definition at line 109 of file ExceptionUtils.cc.
| Int32 Arcane::ExceptionUtils::print | ( | const Exception & | ex, |
| ITraceMng * | tm, | ||
| bool | is_no_continue = true ) |
Prints a message for the standard exception ex.
If tm is not null, it will be used for printing. If is_no_continue is true, it displays a message indicating that execution cannot continue.
| 3 |
Definition at line 90 of file ExceptionUtils.cc.
References Arcane::ITraceMng::error(), and Arcane::Exception::isCollective().
| Int32 Arcane::ExceptionUtils::print | ( | const std::exception & | ex, |
| ITraceMng * | tm, | ||
| bool | is_no_continue = true ) |
Prints a message for the standard exception ex.
If trace_mng is not null, it will be used for printing. If is_no_continue is true, it displays a message indicating that execution cannot continue.
| 2 |
Definition at line 72 of file ExceptionUtils.cc.
References Arcane::ITraceMng::error().
| Int32 Arcane::ExceptionUtils::print | ( | ITraceMng * | tm, |
| bool | is_no_continue = true ) |
Prints a message for an unknown exception.
This function is used for catch(...) expressions.
If trace_mng is not null, it will be used for printing. If is_no_continue is true, it displays a message indicating that execution cannot continue.
| 1 |
Definition at line 55 of file ExceptionUtils.cc.
References Arcane::ITraceMng::error().