Commit 499c835a authored by Pavel Vainerman's avatar Pavel Vainerman

(admin): расширил обработку исключений..

parent 60884957
...@@ -337,7 +337,7 @@ int main(int argc, char** argv) ...@@ -337,7 +337,7 @@ int main(int argc, char** argv)
catch( const CORBA::SystemException& ex ) catch( const CORBA::SystemException& ex )
{ {
if( !quiet ) if( !quiet )
cerr << "поймали CORBA::SystemException:" << ex.NP_minorString() << endl; cerr << "поймали CORBA::SystemException: " << ex.NP_minorString() << endl;
} }
catch( const CORBA::Exception& ) catch( const CORBA::Exception& )
{ {
...@@ -348,7 +348,7 @@ int main(int argc, char** argv) ...@@ -348,7 +348,7 @@ int main(int argc, char** argv)
{ {
if( !quiet ) if( !quiet )
{ {
cerr << "поймали omniORB::fatalException:" << endl; cerr << "поймали omniORB::fatalException: " << endl;
cerr << " file: " << fe.file() << endl; cerr << " file: " << fe.file() << endl;
cerr << " line: " << fe.line() << endl; cerr << " line: " << fe.line() << endl;
cerr << " mesg: " << fe.errmsg() << endl; cerr << " mesg: " << fe.errmsg() << endl;
...@@ -488,6 +488,11 @@ static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository ...@@ -488,6 +488,11 @@ static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository
if( !quiet ) if( !quiet )
cerr << setw(55) << ob << " <--- недоступен!!(CORBA::SystemException): " << ex.NP_minorString() << endl; cerr << setw(55) << ob << " <--- недоступен!!(CORBA::SystemException): " << ex.NP_minorString() << endl;
} }
catch( const std::exception& ex )
{
if( !quiet )
cerr << "std::exception: " << ex.what() << endl;
}
} }
} }
catch( ORepFailed ) catch( ORepFailed )
...@@ -530,6 +535,12 @@ int omap() ...@@ -530,6 +535,12 @@ int omap()
return 1; return 1;
} }
catch( const std::exception& ex )
{
if( !quiet )
cerr << "std::exception: " << ex.what() << endl;
return 1;
}
return 0; return 0;
} }
...@@ -585,6 +596,12 @@ int setValue( const string& args, UInterface& ui ) ...@@ -585,6 +596,12 @@ int setValue( const string& args, UInterface& ui )
err = 1; err = 1;
} }
catch( const std::exception& ex )
{
if( !quiet )
cerr << "std::exception: " << ex.what() << endl;
err = 1;
}
} }
return err; return err;
...@@ -645,6 +662,12 @@ int getValue( const string& args, UInterface& ui ) ...@@ -645,6 +662,12 @@ int getValue( const string& args, UInterface& ui )
err = 1; err = 1;
} }
catch( const std::exception& ex )
{
if( !quiet )
cerr << "std::exception: " << ex.what() << endl;
err = 1;
}
} }
return err; return err;
...@@ -687,6 +710,12 @@ int getCalibrate( const std::string& args, UInterface& ui ) ...@@ -687,6 +710,12 @@ int getCalibrate( const std::string& args, UInterface& ui )
err = 1; err = 1;
} }
catch( const std::exception& ex )
{
if( !quiet )
cerr << "std::exception: " << ex.what() << endl;
err = 1;
}
} }
return err; return err;
...@@ -725,6 +754,12 @@ int getRawValue( const std::string& args, UInterface& ui ) ...@@ -725,6 +754,12 @@ int getRawValue( const std::string& args, UInterface& ui )
err = 1; err = 1;
} }
catch( const std::exception& ex )
{
if( !quiet )
cerr << "std::exception: " << ex.what() << endl;
err = 1;
}
} }
return err; return err;
...@@ -763,6 +798,41 @@ int getChangedTime( const std::string& args, UInterface& ui ) ...@@ -763,6 +798,41 @@ int getChangedTime( const std::string& args, UInterface& ui )
err = 1; err = 1;
} }
catch( const CORBA::SystemException& ex )
{
if( !quiet )
cerr << "CORBA::SystemException: " << ex.NP_minorString() << endl;
err = 1;
}
catch( const CORBA::Exception& )
{
if( !quiet )
cerr << "CORBA::Exception." << endl;
err = 1;
}
catch( const omniORB::fatalException& fe )
{
if( !quiet )
{
cerr << "omniORB::fatalException: " << endl;
cerr << " file: " << fe.file() << endl;
cerr << " line: " << fe.line() << endl;
cerr << " mesg: " << fe.errmsg() << endl;
}
err = 1;
}
catch( const std::exception& ex )
{
if( !quiet )
cerr << "std::exception: " << ex.what() << endl;
err = 1;
}
catch(...)
{
if( !quiet )
cerr << "Unknown exception.." << endl;
err = 1;
}
} }
return err; return err;
...@@ -868,8 +938,39 @@ int oinfo( const string& args, UInterface& ui ) ...@@ -868,8 +938,39 @@ int oinfo( const string& args, UInterface& ui )
} }
catch( const Exception& ex ) catch( const Exception& ex )
{ {
if( !quiet )
cout << "ID='" << it.id << "' ERROR: " << ex << endl; cout << "ID='" << it.id << "' ERROR: " << ex << endl;
} }
catch( const CORBA::SystemException& ex )
{
if( !quiet )
cerr << "CORBA::SystemException: " << ex.NP_minorString() << endl;
}
catch( const CORBA::Exception& )
{
if( !quiet )
cerr << "CORBA::Exception." << endl;
}
catch( const omniORB::fatalException& fe )
{
if( !quiet )
{
cerr << "omniORB::fatalException:" << endl;
cerr << " file: " << fe.file() << endl;
cerr << " line: " << fe.line() << endl;
cerr << " mesg: " << fe.errmsg() << endl;
}
}
catch( const std::exception& ex )
{
if( !quiet )
cerr << "std::exception: " << ex.what() << endl;
}
catch(...)
{
if( !quiet )
cerr << "Unknown exception.." << endl;
}
cout << endl << endl; cout << endl << endl;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment