Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override void OnException(
- ExceptionContext filterContext
- )
- {
- try
- {
- Error error = ControllerCommon.ProcessException(filterContext);
- // return error
- filterContext.Result = HandleError(error.Type);
- filterContext.ExceptionHandled = true;
- }
- catch (Exception ex)
- {
- Logger.Instance.LogImportantInformation(ex.Message, 0, Constants.EventSourcePortal);
- }
- }
- #endregion
- #region Private Methods and Members
- private ActionResult HandleError()
- {
- return HandleError(Error.ErrorType.Unknown);
- }
- private ActionResult HandleError(
- Error.ErrorType errorType
- )
- {
- // set return status code
- HttpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
- Logger.Instance.LogImportantInformation(((int)errorType).ToString(CultureInfo.InvariantCulture), 0, Constants.EventSourcePortal);
- // return error type
- return Content(((int)errorType).ToString(CultureInfo.InvariantCulture), "text/plain");
- }
Add Comment
Please, Sign In to add comment