[asl] 34/177: Fixing exit(FAILURE) issue

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Aug 27 09:22:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository asl.

commit 0b2749a9e8d5419514a12e0c06e7c3b5c163c3c8
Author: AvtechScientific <AvtechScientific at users.noreply.github.com>
Date:   Thu Jun 18 11:35:08 2015 +0300

    Fixing exit(FAILURE) issue
---
 src/aslUtilities.cxx                   | 14 +++++---------
 src/utilities/aslParametersManager.cxx |  2 +-
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/aslUtilities.cxx b/src/aslUtilities.cxx
index 690151b..0ad6cdc 100644
--- a/src/aslUtilities.cxx
+++ b/src/aslUtilities.cxx
@@ -20,7 +20,7 @@
  *
  */
 
-
+#include <stdexcept>
 #include "aslUtilities.h"
 #include <acl/aclUtilities.h>
 
@@ -64,8 +64,7 @@ namespace asl
 	{
 		if (status != CL_SUCCESS)
 		{
-			cerr << "ASL ERROR: " << errorMessage << " (" << status << ")." << endl;
-			exit(EXIT_FAILURE);
+			throw std::logic_error("ASL ERROR: " + string(errorMessage) + " (" + to_string(status) + ")." );
 		}
 	}
 
@@ -74,23 +73,20 @@ namespace asl
 	{
 		if (status != CL_SUCCESS)
 		{
-			cerr << "ASL ERROR: " << errorMessage << " (" << status << ")." << endl;
-			exit(EXIT_FAILURE);
+			throw std::logic_error("ASL ERROR: " + errorMessage + " (" + to_string(status) + ")." );
 		}
 	}
 	
 
 	void errorMessage(const char *errorMessage)
 	{
-		cerr << "ASL ERROR: " << errorMessage << "." << endl;
-		exit(EXIT_FAILURE);
+			throw std::logic_error("ASL ERROR: " + string(errorMessage));	
 	}
 
 
 	void errorMessage(const string & errorMessage)
 	{
-		cerr << "ASL ERROR: " << errorMessage << "." << endl;
-		exit(EXIT_FAILURE);
+			throw std::logic_error("ASL ERROR: " + errorMessage);	
 	}
 
 
diff --git a/src/utilities/aslParametersManager.cxx b/src/utilities/aslParametersManager.cxx
index 0dbfc9c..771db98 100644
--- a/src/utilities/aslParametersManager.cxx
+++ b/src/utilities/aslParametersManager.cxx
@@ -399,7 +399,7 @@ namespace asl
 		{
 			ifstream ifs(configFile);
 			if (!ifs)
-				errorMessage("ParametersManager::load() - Can not open configuration file: " + configFile);
+				errorMessage("Can not open configuration file: " + configFile);
 
 			parsed_options parsed = parse_config_file(ifs, configurationOptions, true);
 			store(parsed, vm);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/asl.git



More information about the debian-science-commits mailing list