public override void OnException(HttpActionExecutedContext ctx) { HttpStatusCode responseStatus = HttpStatusCode.InternalServerError; HttpExceptionData responseData = new HttpExceptionData(); ExceptionTranslator.TranslateException(ctx.Exception, ref responseStatus, ref responseData); if (!ShowStackTrace) { responseData.ErrorStackTrace = null; } ctx.Response = ctx.Request.CreateResponse(responseStatus, responseData); }
public IActionResult CheckOutBooking(CheckOutBooking checkOutBooking) { if (ModelState.IsValid) { try { checkOutBooking.Id = checkOutBooking.BookingId; _domain.Dispatcher.SendCommand(checkOutBooking); return(RedirectToAction("BookingCheckOut", new { result = true, inProcess = true, errorMessage = "" })); } catch (Exception e) { _logger.LogInformation(ExceptionTranslator.TranslateException(e)); return(RedirectToAction("BookingCheckOut", new { result = false, inProcess = true, errorMessage = ExceptionTranslator.TranslateException(e) })); } } return(RedirectToAction("BookingCheckOut", new { result = false, inProcess = true, errorMessage = "Invalid data" })); }