More goal creation / object exists error more informative
@@ -19,7 +19,7 @@ from cairis.core.ARM import *
from cairis.core.Goal import Goal
from cairis.core.GoalEnvironmentProperties import GoalEnvironmentProperties
from cairis.core.GoalParameters import GoalParameters
-from cairis.daemon.CairisHTTPError import ObjectNotFoundHTTPError, MalformedJSONHTTPError, ARMHTTPError, MissingParameterHTTPError, OverwriteNotAllowedHTTPError
+from cairis.daemon.CairisHTTPError import CairisHTTPError, ObjectNotFoundHTTPError, MalformedJSONHTTPError, ARMHTTPError, MissingParameterHTTPError, OverwriteNotAllowedHTTPError
from cairis.misc.KaosModel import KaosModel
from cairis.core.ValueType import ValueType
from cairis.core.ValueTypeParameters import ValueTypeParameters
@@ -27,6 +27,7 @@ from cairis.data.CairisDAO import CairisDAO
from cairis.tools.JsonConverter import json_serialize, json_deserialize
from cairis.tools.ModelDefinitions import GoalEnvironmentPropertiesModel, GoalModel, ConcernAssociationModel, RefinementModel
from cairis.tools.SessionValidator import check_required_keys, get_fonts
+import http
__author__ = 'Robin Quetin, Shamal Faily'
@@ -94,7 +95,7 @@ class GoalDAO(CairisDAO):
self.db_proxy.addGoal(goalParams)
else:
self.close()
- raise OverwriteNotAllowedHTTPError('The provided goal name')
+ raise CairisHTTPError(status_code=http.client.BAD_REQUEST,status="Object exists",message="An object with the name " + goal.theName + " already exists.")
except DatabaseProxyException as ex:
self.close()
raise ARMHTTPError(ex)
