public static async Task <dynamic> RunAsync(Func <Task <dynamic> > action) { try { return(await action()); } catch (Exception ex) { NewRelicAgent.NoticeError(ex); ErrorSignal.FromContext(HttpContext.Current).Raise(ex); Response exceptionResponse = ex.Message; exceptionResponse.StatusCode = HttpStatusCode.NotAcceptable; return(exceptionResponse); } }
public void TrackException(Exception exception, IDictionary <string, string> properties = null, IDictionary <string, double> metrics = null) { AddMetric(metrics); NRClient.NoticeError(exception, properties); }