Report an I/O error. More...
Public Member Functions | |
IOerror (const string &title) | |
Construct from title string. More... | |
IOerror (const dictionary &) | |
Construct from dictionary. More... | |
virtual | ~IOerror () throw () |
Destructor. More... | |
const string & | ioFileName () const |
label | ioStartLineNumber () const |
label | ioEndLineNumber () const |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const string &ioFileName, const label ioStartLineNumber=-1, const label ioEndLineNumber=-1) |
Convert to OSstream. More... | |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &) |
Convert to OSstream. More... | |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const dictionary &) |
Convert to OSstream. More... | |
operator dictionary () const | |
Create and return a dictionary. 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... | |
![]() | |
error (const string &title) | |
Construct from title string. More... | |
error (const dictionary &) | |
Construct from dictionary. More... | |
error (const error &) | |
Construct as copy. More... | |
virtual | ~error () throw () |
Destructor. More... | |
string | message () const |
const string & | functionName () const |
const string & | sourceFileName () const |
label | sourceFileLineNumber () const |
void | throwExceptions () |
void | dontThrowExceptions () |
OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
Convert to OSstream. More... | |
OSstream & | operator() (const string &functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
Convert to OSstream. More... | |
operator OSstream & () | |
Convert to OSstream. More... | |
OSstream & | operator() () |
Explicitly convert to OSstream for << operations. More... | |
operator dictionary () const | |
Create and return a dictionary. 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... | |
Static Public Member Functions | |
static void | SafeFatalIOError (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &, const string &msg) |
Print basic message and exit. Uses cerr if streams not constructed. More... | |
![]() | |
static void | safePrintStack (std::ostream &) |
Helper function to print a stack (if OpenFOAM IO not yet. More... | |
static void | printStack (Ostream &) |
Helper function to print a stack. More... | |
Private Attributes | |
string | ioFileName_ |
label | ioStartLineNumber_ |
label | ioEndLineNumber_ |
Friends | |
Ostream & | operator<< (Ostream &, const IOerror &) |
Additional Inherited Members | |
Severity flags. More... | |
![]() | |
string | functionName_ |
string | sourceFileName_ |
label | sourceFileLineNumber_ |
bool | throwExceptions_ |
OStringStream * | messageStreamPtr_ |
IOerror | ( | const dictionary & | errDict | ) |
|
inline |
Definition at line 223 of file error.H.
References IOerror::ioFileName_.
Referenced by Foam::operator<<().
|
inline |
Definition at line 228 of file error.H.
References IOerror::ioStartLineNumber_.
Referenced by Foam::operator<<().
|
inline |
Definition at line 233 of file error.H.
References IOerror::ioEndLineNumber_.
Referenced by Foam::operator<<().
Foam::OSstream & operator() | ( | const char * | functionName, |
const char * | sourceFileName, | ||
const int | sourceFileLineNumber, | ||
const string & | ioFileName, | ||
const label | ioStartLineNumber = -1 , |
||
const label | ioEndLineNumber = -1 |
||
) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 59 of file IOerror.C.
References error::operator()().
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 | ||
) |
Convert to OSstream.
Prints basic message and returns OSstream for further info.
Definition at line 98 of file IOerror.C.
References dict, dictionary::endLineNumber(), dictionaryName::name(), and dictionary::startLineNumber().
|
static |
Print basic message and exit. Uses cerr if streams not constructed.
yet (at startup). Use in startup parsing instead of FatalError.
Definition at line 118 of file IOerror.C.
References JobInfo::constructed, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOstream::lineNumber(), and IOstream::name().
operator dictionary | ( | ) | const |
Create and return a dictionary.
void exit | ( | const int | errNo = 1 | ) |
Exit : can be called for any error to exit program.
Definition at line 168 of file IOerror.C.
References Foam::abort(), dictionary::add(), JobInfo::constructed, Foam::endl(), Foam::env(), JobInfo::exit(), Foam::exit(), UPstream::exit(), Foam::jobInfo, UPstream::parRun(), and Foam::Perr.
Referenced by Foam::exit(), IFstream::operator()(), and Istream::operator()().
void abort | ( | ) |
Abort : used to stop code for fatal errors.
Definition at line 209 of file IOerror.C.
References JobInfo::abort(), Foam::abort(), UPstream::abort(), dictionary::add(), JobInfo::constructed, Foam::endl(), Foam::env(), Foam::exit(), Foam::jobInfo, UPstream::parRun(), and Foam::Perr.
Referenced by Foam::abort().
|
private |
Definition at line 201 of file error.H.
Referenced by IOerror::ioFileName().
|
private |
Definition at line 202 of file error.H.
Referenced by IOerror::ioStartLineNumber().
|
private |
Definition at line 203 of file error.H.
Referenced by IOerror::ioEndLineNumber().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.