Report an I/O error. More...
#include <error.H>


Public Member Functions | |
| IOerror (const char *title) | |
| Construct from title string. | |
| IOerror (const std::string &title) | |
| Construct from title string. | |
| IOerror (const dictionary &errDict) | |
| Construct from dictionary. | |
| virtual | ~IOerror () noexcept |
| Destructor. | |
| const string & | ioFileName () const noexcept |
| The currently defined IO name for output messages. | |
| label | ioStartLineNumber () const noexcept |
| The currently defined IO start-line number for output messages. | |
| label | ioEndLineNumber () const noexcept |
| The currently defined IO end-line number. | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, string ioFileName, const label ioStartLineNumber=-1, const label ioEndLineNumber=-1) |
| Define basic print message. | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &ioStream) |
| Define basic print message for IO stream. | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const dictionary &dict) |
| Define basic print message for dictionary entries. Uses the dictionary::relativeName() on output. | |
| OSstream & | operator() (const std::string &where, const IOstream &ioStream) |
| Define basic print message for IO stream, independent of a source-file reference. Uses the dictionary::relativeName() on output. | |
| OSstream & | operator() (const std::string &where, const dictionary &dict) |
| Define basic print message for dictionary entries, independent of a source-file reference. Uses the dictionary::relativeName() on output. | |
| operator dictionary () const | |
| Extract a dictionary representation of the error information. | |
| void | exit (const int errNo=1) |
| Exit : can be called for any error to exit program. | |
| void | abort () |
| Abort : used to stop code for fatal errors. | |
| virtual void | write (Ostream &os, const bool withTitle=true) const |
| Print error message. | |
| Public Member Functions inherited from error | |
| error (const char *title) | |
| Construct from title string. | |
| error (const std::string &title) | |
| Construct from title string. | |
| error (const dictionary &errDict) | |
| Construct from dictionary. | |
| error (const error &err) | |
| Copy construct. | |
| virtual | ~error () noexcept |
| Destructor. | |
| string | message () const |
| The accumulated error message. | |
| void | clear () const |
| Clear any accumulated error messages. | |
| const string & | functionName () const noexcept |
| The currently defined function name for output messages. | |
| const string & | sourceFileName () const noexcept |
| The currently defined source-file name for output messages. | |
| int | sourceFileLineNumber () const noexcept |
| The currently defined source-file line number for output messages. | |
| bool | throwing () const noexcept |
| Return the current exception throwing state (on or off). | |
| bool | throwing (const bool on) noexcept |
| Specify exception throwing state (on or off). | |
| OSstream & | stream () |
| Return OSstream for output operations. | |
| operator OSstream & () | |
| Implicit cast to OSstream for << operations. | |
| OSstream & | operator() () |
| Explicit convert to OSstream for << operations. | |
| OSstream & | operator() (string functionName, const char *sourceFileName=nullptr, const int sourceFileLineNumber=-1) |
| Define basic print message with originating function name, optionally with 'source file, line number'. | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName=nullptr, const int sourceFileLineNumber=-1) |
| Define basic print message with originating function name, optionally with 'source file, line number'. | |
| operator dictionary () const | |
| Extract a dictionary representation of the error information. | |
| void | exit (const int errNo=1) |
| Exit : can be called for any error to exit program. | |
| void | abort () |
| Abort : used to stop code for fatal errors. | |
| bool | throwExceptions (const bool on=true) noexcept |
| Specify exception throwing state (default is on). | |
| bool | dontThrowExceptions () noexcept |
| Deactivate exception throwing. | |
Static Public Member Functions | |
| static void | SafeFatalIOError (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &ioStream, const std::string &msg) |
| Print basic message and exit. | |
| Static Public Member Functions inherited from error | |
| static bool | master (const int communicator=-1) |
| Like Pstream::master but with a Pstream::parRun guard in case Pstream has not yet been initialised. | |
| static bool | warnAboutAge (const int version) noexcept |
| Test if an age warning should be emitted. | |
| static bool | warnAboutAge (const char *what, const int version) |
| Emit warning on stderr about something being old. | |
| static void | safePrintStack (std::ostream &os, int size=-1) |
| Helper function to print a stack, with optional upper limit. Used when OpenFOAM IO not yet initialised. | |
| static void | printStack (Ostream &os, int size=-1) |
| Helper function to print a stack, with optional upper limit. | |
| static bool | useAbort () |
| True if FOAM_ABORT is on. | |
Additional Inherited Members | |
| Public Types inherited from error | |
| enum class | handlerTypes : char { DEFAULT = 0 , IGNORE , WARN , STRICT } |
| Handling of errors. The exact handling depends on the local context. More... | |
| Message type, error severity flags. More... | |
| Static Public Attributes inherited from error | |
| static const Enum< handlerTypes > | handlerNames |
| Names of the error handler types. | |
| Protected Member Functions inherited from error | |
| void | simpleExit (const int errNo, const bool isAbort) |
| Exit or abort, without throwing or job control handling. | |
| Protected Attributes inherited from error | |
| string | functionName_ |
| string | sourceFileName_ |
| int | sourceFileLineNumber_ |
| bool | throwing_ |
| std::unique_ptr< OStringStream > | messageStreamPtr_ |
|
explicit |
Construct from title string.
Definition at line 34 of file IOerror.C.
References error::error(), and messageStream::title().
Referenced by IOerror().


|
inlineexplicit |
Construct from title string.
Definition at line 398 of file error.H.
References IOerror(), and messageStream::title().

|
explicit |
Construct from dictionary.
Definition at line 43 of file IOerror.C.
References error::error().

|
virtualnoexcept |
|
inlinenoexcept |
The currently defined IO name for output messages.
Definition at line 417 of file error.H.
References ioFileName(), and Foam::noexcept.
Referenced by ioFileName(), operator()(), and write().


|
inlinenoexcept |
The currently defined IO start-line number for output messages.
Definition at line 425 of file error.H.
References Foam::noexcept.
Referenced by operator()(), and write().

|
inlinenoexcept |
The currently defined IO end-line number.
Definition at line 433 of file error.H.
References Foam::noexcept.
Referenced by operator()(), and write().

| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| string | ioFileName, | ||
| const label | ioStartLineNumber = -1, | ||
| const label | ioEndLineNumber = -1 ) |
Define basic print message.
Definition at line 60 of file IOerror.C.
References error::functionName(), ioEndLineNumber(), ioFileName(), ioStartLineNumber(), os(), error::sourceFileLineNumber(), and error::sourceFileName().

| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const IOstream & | ioStream ) |
Define basic print message for IO stream.
Definition at line 85 of file IOerror.C.
References error::functionName(), error::sourceFileLineNumber(), and error::sourceFileName().

| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const dictionary & | dict ) |
Define basic print message for dictionary entries. Uses the dictionary::relativeName() on output.
Definition at line 105 of file IOerror.C.
References dict, error::functionName(), error::sourceFileLineNumber(), and error::sourceFileName().

| Foam::OSstream & operator() | ( | const std::string & | where, |
| const IOstream & | ioStream ) |
Define basic print message for IO stream, independent of a source-file reference. Uses the dictionary::relativeName() on output.
| Foam::OSstream & operator() | ( | const std::string & | where, |
| const dictionary & | dict ) |
Define basic print message for dictionary entries, independent of a source-file reference. Uses the dictionary::relativeName() on output.
Definition at line 143 of file IOerror.C.
References dict.
|
static |
Print basic message and exit.
Uses cerr if streams not yet constructed (at startup). Use in startup parsing instead of FatalError.
Definition at line 161 of file IOerror.C.
References JobInfo::constructed, Foam::exit(), Foam::FatalIOError, error::functionName(), IOstream::lineNumber(), Foam::nl, IOstream::relativeName(), error::sourceFileLineNumber(), and error::sourceFileName().

| operator dictionary | ( | ) | const |
Extract a dictionary representation of the error information.
References os().

| void exit | ( | const int | errNo = 1 | ) |
Exit : can be called for any error to exit program.
Definition at line 240 of file IOerror.C.
Referenced by Foam::exit().

| void abort | ( | ) |
Abort : used to stop code for fatal errors.
Definition at line 246 of file IOerror.C.
Referenced by Foam::abort().

|
virtual |
Print error message.
Reimplemented from error.
Definition at line 252 of file IOerror.C.
References Foam::foamVersion::api, error::functionName(), ioEndLineNumber(), ioFileName(), ioStartLineNumber(), messageStream::level, error::message(), Foam::nl, os(), Foam::foamVersion::patch, Foam::foamVersion::patched(), error::sourceFileLineNumber(), error::sourceFileName(), and messageStream::title().
Referenced by Foam::operator<<().

