Exemple #1
0
        private void WebException(WebException webException)
        {
            _isRedirect = true;
            var message = NotificationMvcHelper.FormatMessage(webException.ErrorNumber, webException.MessageContent);

            if (_filterContext.RequestContext.HttpContext.Request.IsAjaxRequest())
            {
                IsAjaxRequest(message, false);
            }
            else if (webException.RedirectToRouteResult != null)
            {
                _filterContext.Result = webException.RedirectToRouteResult;
            }
            else if (!ActionName.IsNullOrEmpty())
            {
                _filterContext.Result = new RedirectToRouteResult(_routeValueDictionary);
            }
            else
            {
                GlobalError(message);
            }

            _controller.ShowMessage(NotificationMessageType.Error, message, _isRedirect);

            _filterContext.ExceptionHandled = true;
        }
Exemple #2
0
        private void UnhandledException()
        {
            var message = NotificationMvcHelper.FormatMessage(
                ErrorNumbers.ErrorView, "ErrorView");

            if (_filterContext.RequestContext.HttpContext.Request.IsAjaxRequest())
            {
                IsAjaxRequest(message, false);
            }
            else
            {
                GlobalError(message);
            }

            _controller.ShowMessage(NotificationMessageType.Error, message, _isRedirect);

            _filterContext.ExceptionHandled = true;
        }
Exemple #3
0
        private void ApplicationLayerException(ApplicationLayerException applicationLayerException)
        {
            var message = NotificationMvcHelper.FormatMessage(
                applicationLayerException.ErrorNumber, applicationLayerException.MessageContent);

            if (_filterContext.RequestContext.HttpContext.Request.IsAjaxRequest())
            {
                IsAjaxRequest(message, false);
            }
            else
            {
                GlobalError(message);
            }

            _controller.ShowMessage(NotificationMessageType.Error, message, _isRedirect);

            _filterContext.ExceptionHandled = true;
        }