public ApplicationMessage GetMessage(BussinessException bex) { var appMessage = new ApplicationMessage(); appMessage.Message = "Message not found!"; if (messages.ContainsKey(bex.ExceptionId)) { appMessage = messages[bex.ExceptionId]; } return(appMessage); }
public Message GetMessage(BussinessException bex) { var appMessage = new Message(); appMessage.descripsion = "Message not found!"; if (messages.ContainsKey(bex.ExceptionId)) { appMessage = messages[bex.ExceptionId]; } return(appMessage); }
public void Process(Exception ex) { var bex = new BussinessException(); if (ex.GetType() == typeof(BussinessException)) { bex = (BussinessException)ex; } else { bex = new BussinessException(0, ex); } ProcessBussinesException(bex); }
public void Process(Exception ex) { var bex = new BussinessException(); if (ex.GetType() == typeof(BussinessException)) { bex = (BussinessException)ex; bex.ExceptionDetails = GetMessage(bex).Message; } else { bex = new BussinessException(0, ex); } ProcessBussinesException(bex); }
private void ProcessBussinesException(BussinessException bex) { var today = DateTime.Now.ToString("yyyyMMdd_hh"); var logName = PATH + today + "_" + "log.txt"; var message = bex.ExceptionDetails + "\n" + bex.StackTrace + "\n"; //if (bex.InnerException!=null) // message += bex.InnerException.Message + "\n" + bex.InnerException.StackTrace; using (StreamWriter w = File.AppendText(logName)) { Log(message, w); } bex.AppMessage = GetMessage(bex); throw bex; }