public static BugSenseEx ToBugSenseEx(this Exception ex, string comment) { BugSenseEx be = new BugSenseEx(); be.Comment = comment; be.klass = ex.GetType().FullName; be.occured_at = DateTime.Now; be.message = ex.Message; be.backtrace = GetStackTrace(ex); #if iOS try { // It's likely the Exception message's will be useless... // try to pase the class/method name from the stacktrace. var traceString = ex.StackTrace.ToString(); if (!string.IsNullOrEmpty(traceString)) { var parenthidx = traceString.IndexOf(')'); var periodIdx = traceString.IndexOf('.'); var length = parenthidx - periodIdx; be.where = traceString.Substring(periodIdx + 1, length); } } catch (Exception) { } #else be.where = "NA"; #endif return be; }
public static BugSenseEx ToBugSenseEx(this Exception ex, string comment) { BugSenseEx be = new BugSenseEx(); be.Comment = comment; be.klass = ex.GetType().FullName; be.occured_at = DateTime.Now; be.message = ex.Message; be.backtrace = GetStackTrace(ex); be.where = "NA"; return be; }
public static BugSenseEx ToBugSenseEx(this Exception ex, string comment = null) { BugSenseEx be = new BugSenseEx(); be.Comment = comment; be.ClassName = ex.GetType().FullName; be.DateOccured = DateTime.Now; be.Name = ex.Message; be.StackTrace = GetStackTrace(ex); be.Where = "NA"; be.OriginalException = ex; return be; }
public BugSenseRequest(BugSenseEx ex, AppEnvironment environment) { client = new BugSenseClient(); request = new BugSenseInternalRequest(); request.comment = string.IsNullOrEmpty(ex.Comment) ? ex.message : ex.Comment; exception = ex; this.application_environment = environment; }
public BugSenseRequest(BugSenseEx ex, AppEnvironment environment) { Client = new BugSenseClient(); Request = new BugSenseInternalRequest(); Request.Comment = string.IsNullOrEmpty(ex.Comment) ? ex.Name : ex.Comment; Exception = ex; AppEnvironment = environment; }