Example #1
0
        public async Task <JsonResult> UnhandleErrors(AppErrorVM model)
        {
            // code to send mail
            await Task.Delay(10).ConfigureAwait(false);

            return(Json(new { stat = false, msg = "This feature is not activated." }));
        }
Example #2
0
        public async Task <IActionResult> UnhandleErrors()
        {
            var model = new AppErrorVM();
            var ex    = HttpContext.Features.Get <IExceptionHandlerFeature>();

            model.ErrorCode        = ex.Error.GetHashCode().ToString();
            model.ErrorMessage     = ex.Error.Message;
            model.ErrorDescription = ex.Error.StackTrace;
            model.TrackTrace       = ex.Error.StackTrace;
            model.ErrorSource      = ex.Error.Source;

            var VModel = await GetViewModel(model);

            return(View(VModel));
        }