Cezar Andrei has proposed merging lp:~zorba-coders/zorba/bug1103819-catchAll
into lp:zorba.
Commit message:
Fix catch ( ... ) in XML loaders.
Requested reviews:
Cezar Andrei (cezar-andrei)
Paul J. Lucas (paul-lucas)
Related bugs:
Bug #1103819 in Zorba: Use of catch (...) should be reduced or mitigated
https://bugs.launchpad.net/zorba/+bug/1103819
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug1103819-catchAll/+merge/159053
Fix catch ( ... ) in XML loaders.
--
https://code.launchpad.net/~zorba-coders/zorba/bug1103819-catchAll/+merge/159053
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/store/naive/loader_dtd.cpp'
--- src/store/naive/loader_dtd.cpp 2013-03-05 22:57:42 +
+++ src/store/naive/loader_dtd.cpp 2013-04-16 00:50:38 +
@@ -355,6 +355,16 @@
FragmentXmlLoader::endDocument(theFragmentStream-ctxt-userData); // this would not be called otherwise
}
+ catch( std::exception const e )
+ {
+theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR,
+ ERROR_PARAMS( e.what() )));
+
+abortload();
+thePathStack.clear();
+return NULL;
+ }
catch (...)
{
abortload();
@@ -849,8 +859,19 @@
return NULL;
}
}
+ catch( std::exception const e )
+ {
+theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR, ERROR_PARAMS( e.what() )));
+
+abortload();
+return NULL;
+ }
catch(...)
{
+theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));
+
abortload();
thePathStack.clear();
return NULL;
@@ -1070,6 +1091,12 @@
{
loader.theXQueryDiagnostics-add_error( e );
}
+ catch( std::exception const e )
+ {
+loader.theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics-add_error(
@@ -1152,6 +1179,12 @@
{
loader.theXQueryDiagnostics-add_error( e );
}
+ catch( std::exception const e )
+ {
+loader.theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics-add_error(
@@ -1446,6 +1479,12 @@
{
loader.theXQueryDiagnostics-add_error( e );
}
+ catch( std::exception const e )
+ {
+loader.theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics-
@@ -1578,6 +1617,12 @@
{
loader.theXQueryDiagnostics-add_error( e );
}
+ catch( std::exception const e )
+ {
+loader.theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics-add_error(
@@ -1629,6 +1674,12 @@
{
loader.theXQueryDiagnostics-add_error( e );
}
+ catch( std::exception const e )
+ {
+loader.theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics-add_error(
@@ -1682,6 +1733,12 @@
{
loader.theXQueryDiagnostics-add_error( e );
}
+ catch( std::exception const e )
+ {
+loader.theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics-add_error(
@@ -1732,6 +1789,12 @@
{
loader.theXQueryDiagnostics-add_error( e );
}
+ catch( std::exception const e )
+ {
+loader.theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics-add_error(
@@ -1775,6 +1838,12 @@
{
loader.theXQueryDiagnostics-add_error( e );
}
+ catch( std::exception const e )
+ {
+loader.theXQueryDiagnostics-
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR,
+ ERROR_PARAMS( e.what() )));
+ }
catch (...)
{
loader.theXQueryDiagnostics-add_error(
=== modified file 'src/store/naive/loader_fast.cpp'
--- src/store/naive/loader_fast.cpp 2013-04-08 22:59:58 +
+++ src/store/naive/loader_fast.cpp 2013-04-16 00:50:38 +
@@ -445,7 +445,7 @@
if (numChars 0)
{
theXQueryDiagnostics-
- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));
+add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));