]> WPIA git - cassiopeia.git/blobdiff - src/apps/signer.cpp
upd: only throwing exceptions now
[cassiopeia.git] / src / apps / signer.cpp
index b955943452cf93bd31c36529d1d43cf33204a29c..530c76ced00862f7c6264446ffae229e4d836e4c 100644 (file)
@@ -49,7 +49,7 @@ int main( int argc, const char* argv[] ) try {
 
     std::shared_ptr<BIO> conn = openSerial( serialPath );
     std::shared_ptr<BIO> slip1( BIO_new( toBio<SlipBIO>() ), BIO_free );
-    static_cast<SlipBIO*>( slip1->ptr )->setTarget( std::shared_ptr<OpensslBIO>( new OpensslBIOWrapper( conn ) ) );
+    static_cast<SlipBIO*>( slip1->ptr )->setTarget( std::shared_ptr<OpensslBIO>( new OpensslBIOWrapper( conn ) ), true );
 
     DefaultRecordHandler* dh = new DefaultRecordHandler( std::shared_ptr<Signer>( new SimpleOpensslSigner( ) ), slip1 );
 
@@ -59,10 +59,8 @@ int main( int argc, const char* argv[] ) try {
             dh->handle();
             //} catch( const std::exception &ch ) {
             //std::cout << "Real exception: " << typeid(ch).name() << ", " << ch.what() << std::endl;
-        } catch( const std::string& ch ) {
-            logger::error( "Exception: ", ch );
-        } catch( char const* ch ) {
-            logger::error( "Exception: ", ch );
+        } catch( const std::exception& e ) {
+            logger::error( "Exception: ", e.what() );
         }
     }
 
@@ -71,7 +69,4 @@ int main( int argc, const char* argv[] ) try {
 } catch( std::exception& e ) {
     logger::fatalf( "Fatal Error: %s!\n", e.what() );
     return -1;
-} catch( ... ) {
-    logger::fatal( "Fatal Error: Unknown Exception!\n" );
-    return -1;
 }