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); }
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; }