From 01f207d979d6be17c8cdec293feab48828c0ec3e Mon Sep 17 00:00:00 2001 From: 黄千龙 <huangqianlong@prec-tech.com> Date: 星期五, 08 四月 2022 14:22:52 +0800 Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG --- 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