/usr/lib/petscdir/3.4.2/include/sieve/ALE_exception.hh is in libpetsc3.4.2-dev 3.4.2.dfsg1-8.1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | #ifndef included_ALE_exception_hh
#define included_ALE_exception_hh
#include <stdexcept>
#include <string>
#include <sstream>
typedef std::basic_ostringstream<char> ostringstream;
typedef std::basic_ostringstream<char> ostrstr;
typedef std::string string;
namespace ALE {
class Exception : public std::runtime_error {
public:
explicit Exception(const char * msg) : std::runtime_error(msg){};
explicit Exception(const string& msg) : std::runtime_error(msg){};
explicit Exception(const ostringstream& txt) : std::runtime_error(txt.str()){};
Exception(const Exception& e) : std::runtime_error(e.what()) {};
string msg() const {return std::string(this->what());};
const char *message() const {return this->what();};
// Printing
template <typename Stream_>
friend Stream_& operator<<(Stream_& os, const Exception& e) {
os << "ERROR: " << e.message() << std::endl;
return os;
}
};
class XException {
ostrstr _txt;
public:
XException(){};
explicit
XException(const string& msg) {this->_txt << msg;};
explicit
XException(const ostrstr& txt) {this->_txt << txt.str();};
XException(const XException& e) {this->_txt << e._txt.str();};
//
const string msg() const {return this->_txt.str();};
const char *message() const {return this->_txt.str().c_str();};
// Message input
template<typename Input_>
XException& operator<<(const Input_& in) {
this->_txt << in;
return *this;
}
// Printing
template <typename Stream_>
friend Stream_& operator<<(Stream_& os, const XException& e) {
os << "ERROR: " << e.message() << std::endl;
return os;
}
};// class XException
// A helper function that throws an ALE::Exception with a message identifying the function that returned the given error code,
// including the function and the line where the error occured.
void ERROR(PetscErrorCode ierr, const char *func, int line, const char *msg);
// A helper function that allocates and assembles an error message from a format string
const char *ERRORMSG(const char *fmt, ...);
// A helper function for converting MPI errors to exception
void MPIERROR(PetscErrorCode ierr, const char *func, int line, const char *msg);
}// namespace ALE
// A helper macro that passes __FUNCT__ and __LINE__ with the error msg to the ERROR routine
#define CHKERROR(ierr, msg) \
::ALE::ERROR(ierr, __FUNCT__, __LINE__, msg);
// A helper macro that passes __FUNCT__ and __LINE__ with the error msg to the MPIERROR routine
#define CHKMPIERROR(ierr, msg) \
::ALE::MPIERROR(ierr, __FUNCT__, __LINE__, msg);
#endif
|