示例#1
0
 protected override void OnLoad(EventArgs e)
 {
     this.EnableViewState = true;
     base.OnLoad(e);
     if (base.IsPostBack)
     {
         if (string.Compare(this.SenderButtonId, base.CommitButtonClientID) != 0 && string.Compare(this.SenderButtonId, base.BackButton.ClientID) != 0 && string.Compare(this.SenderButtonId, base.NextButton.ClientID) != 0)
         {
             this.ShowDisabledWizard(Strings.WebServiceErrorMessage);
             return;
         }
     }
     else
     {
         Exception lastError = base.Server.GetLastError();
         if (lastError != null)
         {
             InfoCore infoCore = lastError.ToErrorInformationBase().ToInfo();
             if (lastError.IsMaxRequestLengthExceededException())
             {
                 infoCore.Message = Strings.MigrationFileTooBig;
                 infoCore.Details = string.Empty;
                 base.Server.ClearError();
             }
             ErrorHandlingUtil.ShowServerError(infoCore, this.Page);
         }
     }
 }
示例#2
0
 public static void ShowServerError(InfoCore errorInfo, System.Web.UI.Page page)
 {
     if (errorInfo != null)
     {
         ErrorHandlingUtil.ShowServerErrors(new InfoCore[]
         {
             errorInfo
         }, page);
     }
 }
        public static InfoCore ToInfo(this ErrorInformationBase error)
        {
            InfoCore infoCore = new InfoCore();

            if (error.Exception is WarningException)
            {
                infoCore.MessageBoxType = ModalDialogType.Warning;
                infoCore.JsonTitle      = ClientStrings.Warning;
            }
            else
            {
                infoCore.MessageBoxType = ModalDialogType.Error;
                infoCore.JsonTitle      = ClientStrings.Error;
                infoCore.StackTrace     = error.CallStack;
            }
            if (error.Exception is LocalizedException)
            {
                infoCore.HelpUrl = HelpUtil.BuildErrorAssistanceUrl(error.Exception as LocalizedException);
                infoCore.Help    = ClientStrings.ClickHereForHelp;
            }
            infoCore.Message = error.Message;
            infoCore.Details = ((error.Exception.InnerException != null) ? error.Exception.InnerException.GetFullMessage() : string.Empty);
            return(infoCore);
        }