Report an I/O error. More...


Public Member Functions | |
| IOerror (const string &title) | |
| Construct from title string. More... | |
| IOerror (const dictionary &errDict) | |
| Construct from dictionary. More... | |
| virtual | ~IOerror () noexcept |
| Destructor. More... | |
| const string & | ioFileName () const noexcept |
| The currently defined IO name for output messages. More... | |
| label | ioStartLineNumber () const noexcept |
| The currently defined IO start-line number for output messages. More... | |
| label | ioEndLineNumber () const noexcept |
| The currently defined IO end-line number. More... | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const string &ioFileName, const label ioStartLineNumber=-1, const label ioEndLineNumber=-1) |
| Define basic print message. More... | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &ioStream) |
| Define basic print message for IO stream. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| operator dictionary () const | |
| Extract a dictionary representation of the error information. More... | |
| void | exit (const int errNo=1) |
| Exit : can be called for any error to exit program. More... | |
| void | abort () |
| Abort : used to stop code for fatal errors. More... | |
| virtual void | write (Ostream &os, const bool withTitle=true) const |
| Print error message. More... | |
Public Member Functions inherited from error | |
| error (const string &title) | |
| Construct from title string. More... | |
| error (const dictionary &errDict) | |
| Construct from dictionary. More... | |
| error (const error &err) | |
| Copy construct. More... | |
| virtual | ~error () noexcept |
| Destructor. More... | |
| string | message () const |
| The accumulated error message. More... | |
| void | clear () const |
| Clear any messages. More... | |
| const string & | functionName () const noexcept |
| The currently defined function name for output messages. More... | |
| const string & | sourceFileName () const noexcept |
| The currently defined source-file name for output messages. More... | |
| label | sourceFileLineNumber () const noexcept |
| The currently defined source-file line number for output messages. More... | |
| bool | throwing () const noexcept |
| Return the current exception throwing state (on or off) More... | |
| bool | throwing (const bool on) noexcept |
| Specify exception throwing state (on or off) More... | |
| OSstream & | stream () |
| Return OSstream for output operations. More... | |
| operator OSstream & () | |
| Implicit cast to OSstream for << operations. More... | |
| OSstream & | operator() () |
| Explicit convert to OSstream for << operations. More... | |
| OSstream & | operator() (const string &functionName) |
| Define basic print message. More... | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
| Define basic print message. More... | |
| OSstream & | operator() (const string &functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
| Define basic print message. More... | |
| operator dictionary () const | |
| Extract a dictionary representation of the error information. More... | |
| void | exit (const int errNo=1) |
| Exit : can be called for any error to exit program. More... | |
| void | abort () |
| Abort : used to stop code for fatal errors. More... | |
| bool | throwExceptions (const bool on=true) noexcept |
| Specify exception throwing state (default is on) More... | |
| bool | dontThrowExceptions () noexcept |
| Deactivate exception throwing. More... | |
Static Public Member Functions | |
| static void | SafeFatalIOError (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &ioStream, const string &msg) |
| Print basic message and exit. More... | |
Static Public Member Functions inherited from error | |
| static bool | master (const label communicator=-1) |
| Like Pstream::master but with a Pstream::parRun guard in case Pstream has not yet been initialised. More... | |
| static bool | warnAboutAge (const int version) noexcept |
| Test if an age warning should be emitted. More... | |
| static bool | warnAboutAge (const char *what, const int version) |
| Emit warning on stderr about something being old. More... | |
| 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. More... | |
| static void | printStack (Ostream &os, int size=-1) |
| Helper function to print a stack, with optional upper limit. More... | |
| static bool | useAbort () |
| True if FOAM_ABORT is on. More... | |
Additional Inherited Members | |
| Message type, error severity flags. More... | |
Protected Member Functions inherited from error | |
| void | simpleExit (const int errNo, const bool isAbort) |
| Exit or abort, without throwing or job control handling. More... | |
Protected Attributes inherited from error | |
| string | functionName_ |
| string | sourceFileName_ |
| label | sourceFileLineNumber_ |
| bool | throwing_ |
| std::unique_ptr< OStringStream > | messageStreamPtr_ |
|
explicit |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const string & | ioFileName, | ||
| const label | ioStartLineNumber = -1, |
||
| const label | ioEndLineNumber = -1 |
||
| ) |
| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const IOstream & | ioStream | ||
| ) |
| 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 106 of file IOerror.C.
References dict, dictionary::endLineNumber(), dictionary::relativeName(), and dictionary::startLineNumber().

| 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 144 of file IOerror.C.
References dict, dictionary::endLineNumber(), dictionary::relativeName(), and dictionary::startLineNumber().

|
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 162 of file IOerror.C.
References JobInfo::constructed, Foam::endl(), Foam::exit(), Foam::FatalIOError, IOstream::lineNumber(), Foam::nl, and IOstream::relativeName().

| 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.
Definition at line 239 of file IOerror.C.
Referenced by Foam::exit(), IFstream::operator()(), and Istream::operator()().

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

|
virtual |
Print error message.
Reimplemented from error.
Definition at line 251 of file IOerror.C.
References Foam::foamVersion::api, IOstream::bad(), messageStream::level, Foam::nl, os(), Foam::foamVersion::patch, and Foam::foamVersion::patched().
Referenced by Foam::operator<<().


Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.