From c96c35b3b78dad066aa6f7b989baf6578b65ade7 Mon Sep 17 00:00:00 2001 From: Katie McGoff Date: Fri, 1 Mar 2019 14:53:33 -0800 Subject: [PATCH] reverted error handling to previous version, due to error approved (#540) --- api/namex/services/nro/oracle_services.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/api/namex/services/nro/oracle_services.py b/api/namex/services/nro/oracle_services.py index 18d5a6812..0080b8d31 100644 --- a/api/namex/services/nro/oracle_services.py +++ b/api/namex/services/nro/oracle_services.py @@ -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'): @@ -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: @@ -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: