static void translate_exception(const Exception &e) { stringstream s; s << endl << e.file() << "(" << e.line() << "): " << e.msg(); BOOST_ERROR(s.str().c_str()); for(const Exception &ex: e.causes()) translate_exception(ex); }
QDebug operator<<(QDebug debug, const Exception &exception) { debug.nospace() << "Exception: " << exception.type() << "\n" "Function: " << exception.function() << "\n" "File: " << exception.file() << "\n" "Line: " << exception.line() << "\n"; if (!exception.description().isEmpty()) debug.nospace() << exception.description(); if (!exception.backTrace().isEmpty()) debug.nospace() << exception.backTrace(); return debug.space(); }
bool DigiDoc::parseException( const Exception &e, QStringList &causes, Exception::ExceptionCode &code, int &ddocError ) { causes << QString( "%1:%2 %3").arg( QFileInfo(from(e.file())).fileName() ).arg( e.line() ).arg( from(e.msg()) ); if( e.code() & Exception::DDocError ) ddocError = e.code() & ~Exception::DDocError; switch( e.code() ) { case Exception::CertificateRevoked: case Exception::CertificateUnknown: case Exception::OCSPTimeSlot: case Exception::OCSPRequestUnauthorized: case Exception::PINCanceled: case Exception::PINFailed: case Exception::PINIncorrect: case Exception::PINLocked: code = e.code(); default: break; } Q_FOREACH( const Exception &c, e.causes() ) if( !parseException( c, causes, code, ddocError ) ) return false; return true; }
Exception(const Exception& e) : std::runtime_error(e.what()), f(e.file()), l(e.line()), ep(e.ep) {}