X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fapps%2Fclient.cpp;h=bfb7fb1688148e104ccfaaea1cb69fd9472f155f;hb=e0713d1539887566e0ea7d85942c305ec727c9dd;hp=ca9432e453fa8e4449f400f08d46c971b6ad8f52;hpb=ecdc4c456ebcc3e0871b765d1f4d15e73520d2a3;p=cassiopeia.git diff --git a/src/apps/client.cpp b/src/apps/client.cpp index ca9432e..bfb7fb1 100644 --- a/src/apps/client.cpp +++ b/src/apps/client.cpp @@ -45,8 +45,8 @@ void checkCRLs( std::shared_ptr sign ) { try { std::vector serials; std::pair, std::string> rev = sign->revoke( x.second, serials ); - } catch( const char* c ) { - logger::error( "Exception: ", c ); + } catch( const std::exception &e ) { + logger::error( "Exception: ", e.what() ); } } } @@ -185,24 +185,22 @@ int main( int argc, const char* argv[] ) { } continue; - } catch( const char* c ) { - logger::error( "ERROR: ", c ); - } catch( std::string& c ) { - logger::error( "ERROR: ", c ); + } catch( std::exception& c ) { + logger::error( "ERROR: ", c.what() ); } try { jp->failJob( job ); - } catch( const char* c ) { - logger::error( "ERROR: ", c ); - } catch( std::string& c ) { - logger::error( "ERROR: ", c ); + } catch( std::exception& c ) { + logger::error( "ERROR: ", c.what() ); } } else if( job->task == "revoke" ) { try { + logger::note( "revoking" ); auto data = jp->getRevocationInfo( job ); std::vector serials; serials.push_back( data.first ); + logger::note( "revoking" ); std::pair, std::string> rev = sign->revoke( CAs.at( data.second ), serials ); std::string date = rev.second; const unsigned char* pos = ( const unsigned char* ) date.data(); @@ -210,10 +208,8 @@ int main( int argc, const char* argv[] ) { jp->writeBackRevocation( job, timeToString( time ) ); jp->finishJob( job ); - } catch( const char* c ) { - logger::error( "Exception: ", c ); - } catch( const std::string& c ) { - logger::error( "Exception: ", c ); + } catch( const std::exception& c ) { + logger::error( "Exception: ", c.what() ); } } else { logger::errorf( "Unknown job type (\"%s\")", job->task ); @@ -223,12 +219,8 @@ int main( int argc, const char* argv[] ) { if( !DAEMON || once ) { return 0; } - } catch( const char* c ) { - logger::error( "Exception: ", c ); - } catch( const std::string& c ) { - logger::error( "Exception: ", c ); } catch ( std::exception &e ){ - logger::errorf ( "Exception while fetchJob: %s", e.what() ); + logger::errorf ( "std::exception in mainloop: %s", e.what() ); } }