Skip to content

Commit

Permalink
reverted error handling to previous version, due to error approved (#540
Browse files Browse the repository at this point in the history
)
  • Loading branch information
katiemcgoff authored Mar 1, 2019
1 parent 4b2a486 commit c96c35b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions api/namex/services/nro/oracle_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,13 @@ def set_request_status_to_h(self, nr_num, examiner_username ):
:return: naked
:raise: (NROServicesError) with the error information set
"""
current_app.logger.debug(examiner_username)

try:
con = self.connection
con.begin() # explicit transaction in case we need to do other things than just call the stored proc
try:
cursor = con.cursor()

# set the fqpn if the schema is required, which is set y the deployer/configurator
# if the environment variable is missing from the Flask Config, then skip setting it.
if current_app.config.get('NRO_SCHEMA'):
Expand All @@ -175,12 +176,8 @@ def set_request_status_to_h(self, nr_num, examiner_username ):
'', # p_consent_flag- mandatory, but ignored by the proc
nro_examiner_name(examiner_username), # p_examiner_id
]
# We don't call procedure anymore as it didn't return value. In other words,
# we don't know if the data was processed successfully or not by store procedure.
# Call the name_examination procedure to save complete decision data for a single NR
#cursor.callproc(proc_name, proc_vars)

# Call the function to save complete decision data for a single NR
# Call the name_examination function to save complete decision data for a single NR
# and get a return if all data was saved
ret = cursor.callfunc(func_name, str, func_vars)
if ret is not None:
Expand All @@ -194,8 +191,8 @@ def set_request_status_to_h(self, nr_num, examiner_username ):
current_app.logger.error("NR#:", nr_num, "Oracle-Error-Code:", error.code)
if con:
con.rollback()
raise NROServicesError({"code": "unable_to_set_state",
"description": "Unable to set the state of the NR in NRO"}, 500)
raise NROServicesError({"code": "unable_to_set_state",
"description": "Unable to set the state of the NR in NRO"}, 500)
except Exception as err:
current_app.logger.error("NR#:", nr_num, err.with_traceback(None))
if con:
Expand Down

0 comments on commit c96c35b

Please sign in to comment.