stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r574560 - /incubator/stdcxx/trunk/examples/manual/codecvt1.cpp
Date Tue, 11 Sep 2007 12:04:49 GMT
Author: faridz
Date: Tue Sep 11 05:04:49 2007
New Revision: 574560

URL: http://svn.apache.org/viewvc?rev=574560&view=rev
Log:
2007-09-11 Farid Zaripov <Farid_Zaripov@epam.com>

	* codecvt1.cpp (main): Added output of the error message
	in case of exception caught.

Modified:
    incubator/stdcxx/trunk/examples/manual/codecvt1.cpp

Modified: incubator/stdcxx/trunk/examples/manual/codecvt1.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/examples/manual/codecvt1.cpp?rev=574560&r1=574559&r2=574560&view=diff
==============================================================================
--- incubator/stdcxx/trunk/examples/manual/codecvt1.cpp (original)
+++ incubator/stdcxx/trunk/examples/manual/codecvt1.cpp Tue Sep 11 05:04:49 2007
@@ -207,16 +207,18 @@
     try {
        for (int i = 0; i != sizeof locales / sizeof *locales; i++) 
            do_roundtrip_conversion (locales [i].name, locales [i].buffer);
+
+       do_diff_conversion ();
     }
-    catch (...) {
-        return 1;
-    }
+    catch (const std::exception &e) {
+        std::cout << "Caught an exception: " << e.what () << std::endl;
 
-    try {
-        do_diff_conversion ();
+        return 1;   // Indicate failure.
     }
     catch (...) {
-        return 2;
+        std::cout << "Caught an unknown exception" << std::endl;
+
+        return 1;   // Indicate failure.
     }
 
     return 0;



Mime
View raw message