From fb04e7c01d119c60632b4298d18fd93f3ccb3d79 Mon Sep 17 00:00:00 2001 From: Li Jun <buli@deloitte.com.cn> Date: 星期三, 06 四月 2022 10:32:05 +0800 Subject: [PATCH] 20220405DeployProduction --- force-app/main/default/classes/NewAgencyContactController.cls | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/force-app/main/default/classes/NewAgencyContactController.cls b/force-app/main/default/classes/NewAgencyContactController.cls index 1fafe4d..9b62d4f 100644 --- a/force-app/main/default/classes/NewAgencyContactController.cls +++ b/force-app/main/default/classes/NewAgencyContactController.cls @@ -90,6 +90,7 @@ public static ControllerResponse SaveCore(Sobject sobj, Map<string,object> data,string transId ) { + Integer index = 0; string sobjectTypeValue = sobj.getSObjectType().getDescribe().getName(); System.debug('sobjectTypeValue:'+sobjectTypeValue+' Info:' + JSON.serialize(data)); @@ -114,7 +115,26 @@ r.IsSuccess = true; return r; - } catch(Exception e) { + }catch(DmlException e) { + + System.debug(e.getNumDml()); + System.debug(e.getDmlFields(index)); + System.debug(e.getDmlId(index)); + System.debug(e.getDmlIndex(index)); + System.debug(e.getDmlMessage(index)); + System.debug(e.getDmlStatusCode(index)); + System.debug(e.getDmlType(index)); + system.debug(e.getMessage()); + system.debug(e.getStackTraceString()); + + System.debug('into catch'+e.getMessage()); + Database.rollback(sp); + r.IsSuccess = false; + r.message ='淇濆瓨澶辫触锛屽師鍥�:'+ e.getDmlMessage(index); + PIHelper.saveTransLog(sobjectTypeValue,awsDataId,sobj.Id,transId, Json.serialize(data) ,'failed',r.message); + return r; + + }catch(Exception e) { System.debug('into catch'+e.getMessage()); Database.rollback(sp); r.IsSuccess = false; -- Gitblit v1.9.1