/// <summary> /// QC Issue # 2123 /// will retrieve the Ref_ExceptionError.BusinessDescription column value given the Ref_Exception.ExceptionErrorCode /// from the logging database and add it to the List. /// </summary> /// <param name="repsonseMessageList">List that the exception error will be added to.</param> /// <param name="exceptionErrorCode">value corresponding to the Ref_ExceptionError.ExceptionErrorCode in the logging database</param> /// <param name="messageArgumentList">String Array holding the the message mrguments </param> /// <returns>Boolean - true/message added, false/failed to add message to list, instead "No Description Found" error was added </returns> public bool AddMessage(ResponseMessageList responseMessageList, string exceptionErrorCode, params object[] messageArgumentList) { Log.Debug("Entering AddMessage() ..."); bool success = true; ResponseMessage responseMessage; string description = GetExceptionDescriptionByErrorCode(exceptionErrorCode); if (description == null) { Log.Error("IErrorLookupHelper.GetExceptionDescriptionByErrorCode returned an null description."); string Msg = String.Format("No Description Found for exception Error Code {0} ", exceptionErrorCode); responseMessage = new ResponseMessage(Msg); success = false; } else { String formatMsg; formatMsg = String.Format(description, messageArgumentList); responseMessage = new ResponseMessage(exceptionErrorCode, formatMsg); } responseMessageList.Add(responseMessage); return(success); }
public ResultCodeModel SaveSelfReported(LoanCanonicalType SelfReported) { _log.Info("InvokeSelfReportedService.SaveSelfReported() starting ..."); LoanManagementClient client = null; Dictionary <string, string> paramList = null; ResponseMessageList messageList = new ResponseMessageList(); //try/catch here, and handle results/errors appropriately... ResultCodeModel result = new ResultCodeModel(); try { client = new LoanManagementClient(); result.ResultCode = client.SaveLoanSelfReportedEntry(paramList, ref SelfReported, out messageList); } catch (TimeoutException timeout) { ErrorModel error = new ErrorModel("There was a timeout problem calling the SelfReported Management Service", "InvokeSelfReportedMangementService"); result.ErrorList.Add(error); result.ResultCode = 2;//FAIL; ProxyHelper.HandleServiceException(client); _log.Error("InvokeSelfReportedService.SaveSelfReported() Timeout Exception:" + timeout.Message); } catch (CommunicationException comm) { ErrorModel error = new ErrorModel("There was a communication problem calling the SelfReported Management Service", "InvokeSelfReportedMangementService"); result.ErrorList.Add(error); result.ResultCode = 2;//FAIL; ProxyHelper.HandleServiceException(client); _log.Error("InvokeSelfReportedService.SaveSelfReported() Communication Exception:" + comm.Message); } catch (Exception e) { ErrorModel error = new ErrorModel("There was an exception thrown calling the SelfReported Management Service", "InvokeSelfReportedMangementService"); result.ErrorList.Add(error); result.ResultCode = 2;//FAIL; _log.Error("InvokeSelfReportedService.SaveSelfReported() Exception:" + e.Message); } finally { if (client != null && client.State != CommunicationState.Closed) { ProxyHelper.CloseChannel(client); } } _log.Info("InvokeSelfReportedService.SaveSelfReported() ending ..."); return(result); }
/// <summary> /// QC Issue # 2123 /// will retrieve the Ref_ExceptionError.BusinessDescription column value given the Ref_Exception.ExceptionErrorCode /// from the logging database and add it to the List. /// </summary> /// <param name="repsonseMessageList">List that the exception error will be added to.</param> /// <param name="messageDetails">string which contains the message details to be added to the response message list</param> /// <returns>Boolean - true/message added, false/failed to add message to list, instead "No Description Found" error was added </returns> public bool AddMessageDetails(ResponseMessageList responseMessageList, string messageDetails) { Log.Debug("Entering AddMessage() ..."); bool success = true; ResponseMessage responseMessage; if (messageDetails == String.Empty) { Log.Error("message Details Argument is empty."); string Msg = String.Format("Message Details argument is empty. "); responseMessage = new ResponseMessage(Msg); success = false; } else { responseMessage = new ResponseMessage(messageDetails); } responseMessageList.Add(responseMessage); return(success); }