You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2007/09/11 14:04:49 UTC
svn commit: r574560 - /incubator/stdcxx/trunk/examples/manual/codecvt1.cpp
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 <Fa...@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;