diff --git a/acat2/src/acat.cpp b/acat2/src/acat.cpp index 2001a754e11b55cda32665d544a11e53ee4dfbc9..bfe0ad71fadf0830509f5be7f07e7f060c8ef2fe 100644 --- a/acat2/src/acat.cpp +++ b/acat2/src/acat.cpp @@ -41,9 +41,13 @@ int main(int argc, char** argv) { alib::DataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { - std::cout << exception.error() << std::endl; + std::cerr << exception.error() << std::endl; return 2; + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/aconversions2/src/aconversion.cpp b/aconversions2/src/aconversion.cpp index cccc2e9902738826cd0853691ec6a10db77d203d..fa37f28c3e2932fd7ac8e31b6017c19238118941 100644 --- a/aconversions2/src/aconversion.cpp +++ b/aconversions2/src/aconversion.cpp @@ -97,8 +97,7 @@ int main(int argc, char* argv[]) int long_index = 0, opt = 0; std::string target, algorithm; - while( ( opt = getopt_long( argc, argv,"a:t:vhl", long_options, & long_index ) ) != -1 ) - { + while( ( opt = getopt_long( argc, argv,"a:t:vhl", long_options, & long_index ) ) != -1 ) { switch( opt ) { case 'a': @@ -118,8 +117,7 @@ int main(int argc, char* argv[]) } } - try - { + try { list<Token> tokens; std::string input( istreambuf_iterator<char>( cin ), ( istreambuf_iterator<char>( ) ) ); SaxParseInterface::parseMemory( input, tokens ); @@ -129,12 +127,14 @@ int main(int argc, char* argv[]) ConversionHandler conv( tokens, target, algorithm, cout ); conv.convert( ); return 0; - } - catch( const exception::AlibException & exception ) { + } catch (const exception::AlibException & exception ) { alib::DataFactory::toStdout(exception); - std::cout << exception << std::endl; return 1; - } catch (...) { + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; + } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/aconvert2/src/aconvert.cpp b/aconvert2/src/aconvert.cpp index f1c039a31c2129d026d8a8dfcb0f5328e9df8022..b552cd1c8dd106fd7f4c9c63f82b27003f91fcca 100644 --- a/aconvert2/src/aconvert.cpp +++ b/aconvert2/src/aconvert.cpp @@ -163,9 +163,13 @@ int main(int argc, char* argv[]) { alib::DataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { - std::cout << exception.error() << std::endl; + std::cerr << exception.error() << std::endl; return 2; + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/aderivation2/src/aderivation.cpp b/aderivation2/src/aderivation.cpp index c1bfb1bb9222884affce4424764398406039bfe1..bd2592ac3913baf134954199a9711f93bc9e11a9 100644 --- a/aderivation2/src/aderivation.cpp +++ b/aderivation2/src/aderivation.cpp @@ -51,9 +51,13 @@ int main(int argc, char** argv) { alib::DataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { - std::cout << exception.error() << std::endl; + std::cerr << exception.error() << std::endl; return 2; + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/adeterminize2/src/adeterminize.cpp b/adeterminize2/src/adeterminize.cpp index 49b0d77c53ffa0e48f57fe67483876ed60bc41b4..566b92648f8153c21398749e5832e9facd260f9d 100644 --- a/adeterminize2/src/adeterminize.cpp +++ b/adeterminize2/src/adeterminize.cpp @@ -34,13 +34,17 @@ int main(int argc, char** argv) { alib::DataFactory::toStdout(automaton::determinize::Determinize::determinize(alib::DataFactory::fromTokens<automaton::Automaton>(tokens))); return 0; - } catch (const exception::AlibException& e) { - alib::DataFactory::toStdout(e); + } catch (const exception::AlibException& exception) { + alib::DataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { - std::cout << exception.error() << std::endl; + std::cerr << exception.error() << std::endl; return 2; - } catch (...) { + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; + } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/adiff2/src/adiff.cpp b/adiff2/src/adiff.cpp index 3e63c36f187531dde09ea8f2ed832d8bc2d265bb..84cbe676632e354a9d5b2a9ca6761e5fc38ff923 100644 --- a/adiff2/src/adiff.cpp +++ b/adiff2/src/adiff.cpp @@ -72,13 +72,17 @@ int main(int argc, char** argv) { if(alib::api<exception::AlibException>::first(tokens2)) std::cout << alib::DataFactory::fromTokens<exception::AlibException>(tokens2).getCause() << std::endl; return 2; - } catch (const exception::AlibException& e) { - std::cout << e.getCause() << std::endl; + } catch (const exception::AlibException& exception) { + alib::DataFactory::toStdout(exception); return 1; } catch(const TCLAP::ArgException& exception) { - std::cout << exception.error() << std::endl; + std::cerr << exception.error() << std::endl; return 2; - } catch (...) { + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; + } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/aepsilon2/src/aepsilon.cpp b/aepsilon2/src/aepsilon.cpp index 9498a4f31ca71150682d39158b1bb490b2f42b22..900d83656ba2113ade621adb090003b61238dcfa 100644 --- a/aepsilon2/src/aepsilon.cpp +++ b/aepsilon2/src/aepsilon.cpp @@ -42,7 +42,11 @@ int main(int argc, char** argv) { } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/aintegral2/src/aintegral.cpp b/aintegral2/src/aintegral.cpp index dd2d74e696a68a7cee3682d451c4916be54deb9d..71813ec0b01fc5c2d5a58e243a9ccaea04c7977d 100644 --- a/aintegral2/src/aintegral.cpp +++ b/aintegral2/src/aintegral.cpp @@ -53,7 +53,11 @@ int main(int argc, char** argv) { } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/aminimize2/src/aminimize.cpp b/aminimize2/src/aminimize.cpp index cba10710ad47853907e8e3f6f142857ef9f13f36..3a6c226ecf3bbdcd479255e24d5a6e8fcaf39446 100644 --- a/aminimize2/src/aminimize.cpp +++ b/aminimize2/src/aminimize.cpp @@ -42,7 +42,11 @@ int main(int argc, char** argv) { } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/anormalize2/src/anormalize.cpp b/anormalize2/src/anormalize.cpp index e5bfc4b5ba4a2a17eba86f6d00d0ef5a4499f299..eda475aa216398c4ac32532c0e45f6acb8a00920 100644 --- a/anormalize2/src/anormalize.cpp +++ b/anormalize2/src/anormalize.cpp @@ -41,7 +41,11 @@ int main(int argc, char** argv) { } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/arand2/src/arand.cpp b/arand2/src/arand.cpp index 1096b6a6f93c90cc7cc0eb99c147c09194685ea4..12da4087e3af7c00c15bb0a01fe177d891ec8c59 100644 --- a/arand2/src/arand.cpp +++ b/arand2/src/arand.cpp @@ -72,13 +72,17 @@ int main(int argc, char* argv[]) { } return 0; - } catch( const exception::AlibException & e ) { - alib::DataFactory::toStdout( e ); + } catch( const exception::AlibException & exception ) { + alib::DataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; - } catch (...) { + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; + } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/arename2/src/arename.cpp b/arename2/src/arename.cpp index fc81b088cb4740e06692429d49d7d7a7aa2687dd..14b16c365825bcccc67de9060e150dd18c4f2f77 100644 --- a/arename2/src/arename.cpp +++ b/arename2/src/arename.cpp @@ -41,7 +41,11 @@ int main(int argc, char** argv) { } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/arun2/src/arun.cpp b/arun2/src/arun.cpp index dfe6c9d39d3b8db14fe0b17226e181ca32872259..69cbad7756039aa5b3c3409b2f36d2bc1803b55b 100644 --- a/arun2/src/arun.cpp +++ b/arun2/src/arun.cpp @@ -72,13 +72,17 @@ int main(int argc, char* argv[]) { throw exception::AlibException( "Invalid run type" ); return 1; } - } catch( const exception::AlibException & e ) { - alib::DataFactory::toStdout( e ); + } catch( const exception::AlibException & exception ) { + alib::DataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; - } catch (...) { + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; + } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/astat2/src/astat.cpp b/astat2/src/astat.cpp index 3b2dffd0843c8e15ad569ece6f5be44238ccd945..03de60fcec3801ffc537ce0c4cd7bfef87727917 100644 --- a/astat2/src/astat.cpp +++ b/astat2/src/astat.cpp @@ -136,13 +136,17 @@ int main(int argc, char* argv[]) { throw exception::AlibException( "Input not recognized." ); return 1; } - } catch( const exception::AlibException & e ) { - alib::DataFactory::toStdout( e ); + } catch( const exception::AlibException & exception ) { + alib::DataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; - } catch (...) { + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; + } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/astringology2/src/astringology.cpp b/astringology2/src/astringology.cpp index 35c67edbabe602fb7c480c0096ceeaecb91e379b..65029862d9049ddcdd070c4e990540dac300195a 100644 --- a/astringology2/src/astringology.cpp +++ b/astringology2/src/astringology.cpp @@ -72,13 +72,17 @@ int main(int argc, char* argv[]) { throw exception::AlibException( "Invalid algorithm" ); return 1; } - } catch( const exception::AlibException & e ) { - alib::DataFactory::toStdout( e ); + } catch( const exception::AlibException & exception ) { + alib::DataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; - } catch (...) { + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; + } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } } diff --git a/atrim2/src/atrim.cpp b/atrim2/src/atrim.cpp index ea04560a24529d4a93ec1e0f34a584e7e22d55bc..a74effd36c5045a1b0960a20a12c6b5c501f53ae 100644 --- a/atrim2/src/atrim.cpp +++ b/atrim2/src/atrim.cpp @@ -98,13 +98,17 @@ int main(int argc, char* argv[]) { throw exception::AlibException( "Input not recognized." ); return 1; } - } catch( const exception::AlibException & e ) { - alib::DataFactory::toStdout( e ); + } catch( const exception::AlibException & exception ) { + alib::DataFactory::toStdout( exception ); return 1; } catch(const TCLAP::ArgException& exception) { std::cout << exception.error() << std::endl; return 2; - } catch (...) { + } catch (const std::exception& exception) { + std::cerr << "Exception caught: " << exception.what() << std::endl; + return 3; + } catch(...) { + std::cerr << "Unknown exception caught." << std::endl; return 127; } }