Base class for an exception. More...
Public Member Functions | |
| Exception & | operator= (const Exception &)=delete |
| Exception (const String &name, const String &where) | |
| Exception (const String &name, const TraceInfo &where) | |
| Exception (const String &name, const String &awhere, const String &message) | |
| Exception (const String &name, const TraceInfo &trace, const String &message) | |
| Exception (const String &name, const String &where, const StackTrace &stack_trace) | |
| Exception (const String &name, const TraceInfo &where, const StackTrace &stack_trace) | |
| Exception (const String &name, const String &where, const String &message, const StackTrace &stack_trace) | |
| Exception (const String &name, const TraceInfo &trace, const String &message, const StackTrace &stack_trace) | |
| Exception (const Exception &) | |
| Copy constructor. | |
| ~Exception () ARCCORE_NOEXCEPT override | |
| Releases resources. | |
| virtual void | write (std::ostream &o) const |
| bool | isCollective () const |
| True if it is a collective error (concerns all processors). | |
| void | setCollective (bool v) |
| Sets the collective state of the expression. | |
| void | setAdditionalInfo (const String &v) |
| Sets the additional information. | |
| const String & | additionalInfo () const |
| Returns the additional information. | |
| const StackTrace & | stackTrace () const |
| Call stack at the moment of the exception (requires a stacktrace service). | |
| const String & | stackTraceString () const |
| Call stack at the moment of the exception (requires a stacktrace service). | |
| const String & | message () const |
| Exception message. | |
| const String & | where () const |
| Location of the exception. | |
| const String & | name () const |
| Name of the exception. | |
Static Public Member Functions | |
| static bool | hasPendingException () |
| Indicates if there are pending exceptions. | |
| static void | staticInit () |
Protected Member Functions | |
| virtual void | explain (std::ostream &o) const |
| Explains the cause of the exception in the stream o. | |
| void | setMessage (const String &msg) |
| Sets the exception message. | |
Private Member Functions | |
| void | _setStackTrace () |
| void | _setWhere (const TraceInfo &where) |
| void | _checkExplainAndPause () |
Private Attributes | |
| String | m_name |
| String | m_where |
| StackTrace | m_stack_trace |
| String | m_message |
| String | m_additional_info |
| bool | m_is_collective = false |
Static Private Attributes | |
| static std::atomic< Int32 > | m_nb_pending_exception |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const Exception &ex) |
| Output operator. | |
Base class for an exception.
Exceptions are managed by the C++ try and catch code. All exceptions thrown in the code must derive from this class.
An exception can be collective. This means it will be thrown by all processors. In this case, it is possible to display only a single message and possibly stop the execution cleanly.
Definition at line 47 of file arccore/src/base/arccore/base/Exception.h.
Constructs an exception of name name and sent from the function where.
Definition at line 72 of file arccore/src/base/arccore/base/Exception.cc.
Referenced by Arcane::AssertionException::AssertionException(), Arcane::AssertionException::AssertionException(), Arcane::BadIDException::BadIDException(), Arcane::BadItemIdException::BadItemIdException(), Arcane::CaseOptionException::CaseOptionException(), Arcane::CaseOptionException::CaseOptionException(), Arcane::CaseOptionException::CaseOptionException(), Arcane::CaseOptionException::CaseOptionException(), Exception(), and operator<<.
Constructs an exception of name name and sent from the function awhere.
Definition at line 128 of file arccore/src/base/arccore/base/Exception.cc.
Constructs an exception of name name, sent from the function awhere and with the message message.
Definition at line 85 of file arccore/src/base/arccore/base/Exception.cc.
| Arcane::Exception::Exception | ( | const String & | name, |
| const TraceInfo & | trace, | ||
| const String & | message ) |
Constructs an exception of name name, sent from the function where and with the message message.
Definition at line 141 of file arccore/src/base/arccore/base/Exception.cc.
| Arcane::Exception::Exception | ( | const String & | name, |
| const String & | where, | ||
| const StackTrace & | stack_trace ) |
Constructs an exception of name name and sent from the function where.
Definition at line 99 of file arccore/src/base/arccore/base/Exception.cc.
| Arcane::Exception::Exception | ( | const String & | name, |
| const TraceInfo & | where, | ||
| const StackTrace & | stack_trace ) |
Constructs an exception of name name and sent from the function where.
Definition at line 156 of file arccore/src/base/arccore/base/Exception.cc.
| Arcane::Exception::Exception | ( | const String & | name, |
| const String & | where, | ||
| const String & | message, | ||
| const StackTrace & | stack_trace ) |
Constructs an exception of name name, sent from the function where and with the message message.
Definition at line 113 of file arccore/src/base/arccore/base/Exception.cc.
| Arcane::Exception::Exception | ( | const String & | name, |
| const TraceInfo & | trace, | ||
| const String & | message, | ||
| const StackTrace & | stack_trace ) |
Constructs an exception of name name, sent from the function where and with the message message.
Definition at line 171 of file arccore/src/base/arccore/base/Exception.cc.
| Arcane::Exception::Exception | ( | const Exception & | from | ) |
Copy constructor.
Definition at line 187 of file arccore/src/base/arccore/base/Exception.cc.
References Exception().
|
override |
Releases resources.
Definition at line 202 of file arccore/src/base/arccore/base/Exception.cc.
|
private |
Definition at line 287 of file arccore/src/base/arccore/base/Exception.cc.
|
private |
Definition at line 211 of file arccore/src/base/arccore/base/Exception.cc.
|
private |
Definition at line 223 of file arccore/src/base/arccore/base/Exception.cc.
|
inline |
Returns the additional information.
Definition at line 118 of file arccore/src/base/arccore/base/Exception.h.
Referenced by Arcane::TimeLoopMng::doComputeLoop().
|
protectedvirtual |
Explains the cause of the exception in the stream o.
This method allows adding additional information to the exception message.
Reimplemented in Arcane::AssertionException, Arcane::BadAlignmentException, Arcane::BadExpressionException, Arcane::BadIDException, Arcane::BadItemIdException, Arcane::BadOperandException, Arcane::BadOperationException, Arcane::BadPartialVariableItemGroupNameException, Arcane::BadReferenceException, Arcane::BadVariableKindTypeException, Arcane::BadVariantTypeException, Arcane::CaseOptionException, Arcane::FatalErrorException, Arcane::GoBackwardException, Arcane::IndexOutOfRangeException, Arcane::InternalErrorException, Arcane::InvalidArgumentException, Arcane::IOException, Arcane::LicenseErrorException, Arcane::NotImplementedException, Arcane::NotSupportedException, Arcane::ParallelFatalErrorException, Arcane::ReaderWriterException, Arcane::SignalException, Arcane::TimeoutException, Arcane::UnknownItemTypeException, Arccore::FatalErrorException, Arccore::IndexOutOfRangeException, Arccore::NotImplementedException, Arccore::NotSupportedException, and Arccore::TimeoutException.
Definition at line 269 of file arccore/src/base/arccore/base/Exception.cc.
|
static |
Indicates if there are pending exceptions.
Definition at line 250 of file arccore/src/base/arccore/base/Exception.cc.
|
inline |
True if it is a collective error (concerns all processors).
Definition at line 109 of file arccore/src/base/arccore/base/Exception.h.
Referenced by Arcane::ArcaneMain::callFunctorWithCatchedException(), Arcane::ArcaneMainExecInfo::initialize(), and Arcane::ExceptionUtils::print().
|
inline |
Exception message.
Definition at line 130 of file arccore/src/base/arccore/base/Exception.h.
Referenced by Arcane::CaseOptionException::CaseOptionException(), and Arcane::CaseOptionException::CaseOptionException().
|
inline |
Name of the exception.
Definition at line 136 of file arccore/src/base/arccore/base/Exception.h.
Referenced by Arcane::BadPartialVariableItemGroupNameException::explain(), and Arcane::BadVariableKindTypeException::explain().
|
inline |
Sets the additional information.
Definition at line 115 of file arccore/src/base/arccore/base/Exception.h.
|
inline |
Sets the collective state of the expression.
Definition at line 112 of file arccore/src/base/arccore/base/Exception.h.
Referenced by Arcane::CaseOptionException::CaseOptionException(), Arcane::CaseOptionException::CaseOptionException(), Arcane::CaseOptionException::CaseOptionException(), and Arcane::CaseOptionException::CaseOptionException().
|
inlineprotected |
Sets the exception message.
Definition at line 158 of file arccore/src/base/arccore/base/Exception.h.
|
inline |
Call stack at the moment of the exception (requires a stacktrace service).
Definition at line 121 of file arccore/src/base/arccore/base/Exception.h.
|
inline |
Call stack at the moment of the exception (requires a stacktrace service).
Definition at line 124 of file arccore/src/base/arccore/base/Exception.h.
|
static |
Definition at line 260 of file arccore/src/base/arccore/base/Exception.cc.
Referenced by Arcane::ArcaneMain::arcaneInitialize().
|
inline |
Location of the exception.
Definition at line 133 of file arccore/src/base/arccore/base/Exception.h.
Referenced by Arcane::BadIDException::BadIDException(), Arcane::BadItemIdException::BadItemIdException(), Arcane::CaseOptionException::CaseOptionException(), Arcane::CaseOptionException::CaseOptionException(), Arcane::CaseOptionException::CaseOptionException(), and Arcane::CaseOptionException::CaseOptionException().
|
virtual |
Definition at line 232 of file arccore/src/base/arccore/base/Exception.cc.
|
friend |
Output operator.
Definition at line 277 of file arccore/src/base/arccore/base/Exception.cc.
References Exception(), and operator<<.
Referenced by operator<<.
|
private |
Definition at line 169 of file arccore/src/base/arccore/base/Exception.h.
|
private |
Definition at line 170 of file arccore/src/base/arccore/base/Exception.h.
|
private |
Definition at line 168 of file arccore/src/base/arccore/base/Exception.h.
|
private |
Definition at line 165 of file arccore/src/base/arccore/base/Exception.h.
|
staticprivate |
Definition at line 178 of file arccore/src/base/arccore/base/Exception.h.
|
private |
Definition at line 167 of file arccore/src/base/arccore/base/Exception.h.
|
private |
Definition at line 166 of file arccore/src/base/arccore/base/Exception.h.