Esempio n. 1
0
int DigiDocSignature::parseException( const digidoc::Exception &e ) const
{
	Q_FOREACH( const Exception &c, e.getCauses() )
	{
		int code = parseException( c );
		if( code != Exception::NoException )
			return code;
	}
	return e.code();
}
Esempio n. 2
0
void getExceptionMsg(const digidoc::Exception& e
                     , std::stringstream& addTo
                     , size_t depth
                    )
{
    addTo << indent(depth)
          << "Exception[" << e.getMsg() << "]"
          << std::endl;

    if ( e.hasCause() )
    {
        digidoc::Exception::Causes causedBy = e.getCauses();

        addTo << indent(depth + 1) << "Caused by:" << std::endl;
        for ( digidoc::Exception::Causes::const_iterator it = causedBy.begin()
                ; it != causedBy.end()
                ; it++ )
        {
            getExceptionMsg(*it, addTo, depth + 1); // recurse
        }

    }
}