コード例 #1
0
ファイル: Exceptions.cs プロジェクト: mind0n/hive
		public static Exception Log(Exception error, ExceptionType type, OutputHandler OutputCallback)
		{
			lock (Lock)
			{
				OutputHandler callback = new OutputHandler(delegate(Exception e, ExceptionType t) { });
				Errors.Add(new ExceptionItem(error, type));
				if (Output != null)
				{
					callback = Output;
				}
				if (OutputCallback != null)
				{
					callback = OutputCallback;
				}
				if (callback != null)
				{
					callback(error, type);
				}
				Logger.Log(">> Exception Detected >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
				//System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace();
				//for (int i = 0; i < st.FrameCount; i++)
				//{
				//    System.Diagnostics.StackFrame sf = st.GetFrame(i);
				//    Logger.Log(String.Format(">> File name:{0}\tLine:{1}\tColumn:{2}\tMethodName:{3} ", sf.GetFileName(), sf.GetFileLineNumber(), sf.GetFileColumnNumber(), sf.GetMethod().Name));
				//}
				Logger.Log(error.ToString());
			}
			return error;
		}
コード例 #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="exType">Type of ExceptionType.</param>
 /// <param name="message">The error message for this exception.</param>
 /// <param name="innerException">The inner exception that is wrapped in this exception.</param>
 public CustomException(ExceptionType exType, string message, System.Exception innerException)
     : base(message, innerException)
 {
     //this.CustomMessage = rm.GetString(exType.ToString());
     this.CustomMessage = ExpResources.ExpResources.ResourceManager.GetString(exType.ToString()) ?? "[[" + exType.ToString() + "]]";
     this.ExceptionType = exType.ToString();
 }
コード例 #3
0
        // modloader errors can be constructed without parameters
        public ExceptionLogger()
        {
            this.version = ModLoader.getVersion();
            this.url = "http://mods.scrollsguide.com";

            this.type = ExceptionType.MODLOADER;
        }
コード例 #4
0
ファイル: Exception.cs プロジェクト: mrLunatic/NET_Modbus
 internal ModbusException(int DeviceAddress, FunctionCode FunctionCode, ExceptionType Type, string Comment = null)
 {
     this.Type = Type;  
     this.DeviceAddress = DeviceAddress;
     this.Code = FunctionCode;
     this.Comment = Comment;
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:StylesSheetException"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="controlName">Name of the control.</param>
 /// <param name="styleName">Name of the style.</param>
 public StylesSheetException(ExceptionType type, string styleName, string controlName, string propertyName, string propertyValue)
 {
     this.type = type;
     this.styleName = styleName;
     this.controlName = controlName;
     this.propertyName = propertyName;
     this.propertyValue = propertyValue;
 }
コード例 #6
0
ファイル: EEPException.cs プロジェクト: san90279/UK_OAS
 /************************************************************************
  * type:        抛出的异常类型
  * sourceType:  抛出异常所在的类
  * sourceID:    抛出异常所在的控件ID,没有ID则为null
  * key:         参数的名称(参数错误)
  *              属性的名称(属性错误)
  *              方法的名称(方法错误)
  *              控件的类型名(控件错误)
  *              字段的名称(字段错误)
  * value:       参数的值(参数错误)
  *              属性的值(属性错误)
  *              null(方法错误)
  *              控件的ID(Component没有ID则为null)(控件错误)
  *              字段的值(字段错误)
 ************************************************************************/
 /// <summary>
 /// 
 /// </summary>
 /// <param name="type"></param>
 /// <param name="sourceType"></param>
 /// <param name="key"></param>
 /// <param name="value"></param>
 /// <param name="controlID"></param>
 public EEPException(ExceptionType type, Type sourceType, string sourceID, string key, string value)
 {
     _type = type;
     _sourceType = sourceType;
     _sourceID = sourceID;
     _key = key;
     _value = value;
 }
コード例 #7
0
        public ExceptionLogger(Mod m, Repo r)
        {
            this.version = m.version;
            this.url = r.url;
            this.id = m.id;

            this.type = ExceptionType.MOD;
        }
コード例 #8
0
ファイル: EngineException.cs プロジェクト: jonathanm/CodeBox
 public EngineException(ExceptionType type, string message, Token token)
 {
     Type = type;
     Message = message;
     Token = token;
     Line = token.Line;
     Position = token.Position;
 }
コード例 #9
0
ファイル: EngineException.cs プロジェクト: jonathanm/CodeBox
 public EngineException(ExceptionType type, string message)
 {
     Type = type;
     Message = message;
     Token = new Token(TokenType.IDENTIFIER, "", null);
     Line = (GetCurrentLine == null) ? 0 : GetCurrentLine();
     Position = 0;
 }
コード例 #10
0
 internal static Exception CreateException(string res, string[] args, ExceptionType exceptionType, int lineNo, int linePos)
 {
     switch (exceptionType)
     {
         case ExceptionType.ArgumentException:
             return new ArgumentException(Res.GetString(res, args));
     }
     return new XmlException(res, args, lineNo, linePos);
 }
コード例 #11
0
        public static RemotingException Read(Serializer iprot)
        {
            string message = null;
            ExceptionType type = ExceptionType.Unknown;

            message = iprot.ReadString();
            type = (ExceptionType)iprot.ReadI32();

            return new RemotingException(type, message);
        }
コード例 #12
0
ファイル: Logger.cs プロジェクト: RaringCoder/Crucial-CQRS
 public void LogException(string message, Exception exception, ExceptionType exceptionType = ExceptionType.Handled)
 {
     if (exceptionType == ExceptionType.Unhandled)
     {
         Fatal(message, exception);
     }
     else
     {
         Error(message, exception);
     }
 }
コード例 #13
0
ファイル: Logger.cs プロジェクト: RaringCoder/Crucial-CQRS
 public void LogException(Exception exception, HttpRequest httpRequest, ExceptionType exceptionType = ExceptionType.Handled)
 {
     if (exceptionType == ExceptionType.Unhandled)
     {
         Fatal(ExceptionToString(exception), exception, httpRequest);
     }
     else
     {
         Error(ExceptionToString(exception), exception, httpRequest);
     }
 }
コード例 #14
0
ファイル: Logger.cs プロジェクト: RaringCoder/Crucial-CQRS
 public void LogException(string message, Exception exception, HttpRequestBase httpRequestBase, ExceptionType exceptionType = ExceptionType.Handled)
 {
     if (exceptionType == ExceptionType.Unhandled)
     {
         Fatal(message, exception, httpRequestBase);
     }
     else
     {
         Error(message, exception, httpRequestBase);
     }
 }
コード例 #15
0
ファイル: HotException.cs プロジェクト: afkpost/HotCit
 public HotCitException(ExceptionType type, string msg = "")
 {
     switch (type) {
         case ExceptionType.BadAction: throw new BadActionException(msg);
         case ExceptionType.IllegalInput: throw new IllegalInputException(msg);
         case ExceptionType.IllegalState: throw new IllegalStateException(msg);
         case ExceptionType.Impossible: throw new ImpossibleException(msg);
         case ExceptionType.NotEnoughGold: throw new NotEnoughGoldException(msg);
         case ExceptionType.NotFound: throw new NotFoundException(msg);
         case ExceptionType.Timeout: throw new TimeoutException(msg);
     }
 }
コード例 #16
0
		public static TApplicationException Read(TProtocol iprot)
		{
			TField field;

			string message = null;
			ExceptionType type = ExceptionType.Unknown;

			iprot.ReadStructBegin();
			while (true)
			{
				field = iprot.ReadFieldBegin();
				if (field.Type == TType.Stop)
				{
					break;
				}

				switch (field.ID)
				{
					case 1:
						if (field.Type == TType.String)
						{
							message = iprot.ReadString();
						}
						else
						{
							TProtocolUtil.Skip(iprot, field.Type);
						}
						break;
					case 2:
						if (field.Type == TType.I32)
						{
							type = (ExceptionType)iprot.ReadI32();
						}
						else
						{
							TProtocolUtil.Skip(iprot, field.Type);
						}
						break;
					default:
						TProtocolUtil.Skip(iprot, field.Type);
						break;
				}

				iprot.ReadFieldEnd();
			}

			iprot.ReadStructEnd();

			return new TApplicationException(type, message);
		}
コード例 #17
0
ファイル: FluentCsvException.cs プロジェクト: rhwy/SampArch
 private void SetMessageOnType(ExceptionType type, string message)
 {
     switch (type)
     {
         case ExceptionType.MethodChainingException:
             _template = "You can not chain these methods : {0}";
             break;
         case ExceptionType.ArgumentNotMatchException:
             _template = "argument not match : {0}";
             break;
         case ExceptionType.MemberSerializeException:
             _template = "the colum member can not be serialized to string: {0}";
             break;
         default:
             _template = "{0}";
             break;
     }
     _message = string.Format(_template, message);
 }
コード例 #18
0
        public QStrategyException(string message, Exception innerException, ExceptionType exceptionType, string sourceLocation)
            : base(message, innerException)
        {
            this.exceptionType = exceptionType;
            this.sourceLocation = sourceLocation;
            string messageDetail = message;
            message = exceptionType.ToString();
            if (innerException != null)
            {
                while (innerException.InnerException != null)
                {
                    innerException = innerException.InnerException;
                }
                message = innerException.Message;
                messageDetail = innerException.StackTrace;
            }

            string messageLog = string.Format("ExceptionType: {0}, Source:{1}, Exception:{2} MessageDetails: {3}", ExceptionType.ToString(), sourceLocation, message, messageDetail);
            LogUtil.WriteLog(LogLevel.ERROR, messageLog);
        }
コード例 #19
0
ファイル: Manager.cs プロジェクト: BjkGkh/R106
        internal static void BroadcastExceptionNotification(ExceptionType type, int token)
        {
            switch (type)
            {
                case ExceptionType.StandardException:
                    {
                        BroadcastMessage("exception:id=1," + token);
                        break;
                    }

                case ExceptionType.FatalException:
                    {
                        BroadcastMessage("exception:id=2," + token);
                        break;
                    }

                case ExceptionType.SQLException:
                    {
                        BroadcastMessage("exception:id=3," + token);
                        break;
                    }

                case ExceptionType.ThreadedException:
                    {
                        BroadcastMessage("exception:id=4," + token);
                        break;
                    }

                case ExceptionType.UserException:
                    {
                        BroadcastMessage("exception:id=5," + token);
                        break;
                    }

                case ExceptionType.DDOSException:
                    {
                        BroadcastMessage("exception:id=6," + token);
                        break;
                    }
            }
        }
コード例 #20
0
        public static string GetString(ExceptionType exceptionType)
        {
            string lValue = string.Empty;

              switch(exceptionType)
              {
               case ExceptionType.ExistingVariableInCalcMemory:
                    lValue = "Variável '{0}' duplicada na memória de cálculo";
                    break;
               case ExceptionType.NumberOfAssigmentTokens:
                    lValue = "Número de símbolos de atribuição (=) inconsistente na expressão '{0}'";
                    break;
               case ExceptionType.VariableNotFoundInCalcMemory:
                    lValue = "Variável '{0}' não encontrada na memória de cálculo";
                    break;
              default:
                  lValue = "Exceção não definida";
                  break;
              }

              return lValue;
        }
コード例 #21
0
ファイル: Exception.cs プロジェクト: lisiynos/pascalabcnet
		internal Exception(Thread thread)
		{
			creationTime = DateTime.Now;
			this.process = thread.Process;
			this.thread = thread;
			corValue = thread.CorThread.CurrentException;
			exceptionType = thread.CurrentExceptionType;
			Value runtimeValue = new Value(process,
			                               new IExpirable[] {process.PauseSession},
			                               new IMutable[] {},
			                               delegate { return corValue; } );
			NamedValue nv = runtimeValue.GetMember("_message");
			if (!nv.IsNull)
			message = nv.AsString;
			else message = runtimeValue.Type.FullName;
			if (thread.LastFunctionWithLoadedSymbols != null) {
				location = thread.LastFunctionWithLoadedSymbols.NextStatement;
			}
			
			callstack = "";
			int callstackItems = 0;
			if (!nv.IsNull)
			foreach(Function function in thread.Callstack) {
				if (callstackItems >= 100) {
					callstack += "...\n";
					break;
				}
				
				SourcecodeSegment loc = function.NextStatement;
				callstack += function.Name + "()";
				if (loc != null) {
					callstack += " - " + loc.SourceFullFilename + ":" + loc.StartLine + "," + loc.StartColumn;
				}
				callstack += "\n";
				callstackItems++;
			}
			
			type = runtimeValue.Type.FullName;
		}
コード例 #22
0
        private static void HandleException(ExceptionType exceptionType, Exception exception, string source)
        {
            using (var eventLog = new EventLog())
            {
                if (!System.Diagnostics.EventLog.SourceExists(source))
                {
                    System.Diagnostics.EventLog.CreateEventSource(source, "Application");
                }
                eventLog.Source = source;
                eventLog.Log = "Application";

                StringBuilder message = new StringBuilder();
                message.AppendLine("A " + source + " " + exceptionType.ToString() + " occurred with the following details:");
                message.AppendLine();
                message.AppendLine(exception.Message);
                if (exception.InnerException != null)
                {
                    message.AppendLine();
                    message.AppendLine("InnerException:");
                    message.AppendLine(exception.InnerException.ToString());
                }
                message.AppendLine();
                message.AppendLine("StackTrace:");
                message.AppendLine(exception.StackTrace);

                eventLog.WriteEntry(message.ToString(), System.Diagnostics.EventLogEntryType.Error);

                StringBuilder returnMessage = new StringBuilder();
                returnMessage.AppendLine("Exception:");
                returnMessage.AppendLine(exception.Message);
                if (exception.InnerException != null)
                {
                    returnMessage.AppendLine();
                    returnMessage.AppendLine("Inner Exception:");
                    returnMessage.AppendLine(exception.InnerException.Message);
                }
            }
        }
コード例 #23
0
ファイル: MOS6502.cs プロジェクト: ddugovic/RASuite
		void TriggerException(ExceptionType type)
		{
			if (type == ExceptionType.BRK)
				PC++;
			WriteMemory((ushort)(S-- + 0x100), (byte)(PC >> 8));
			WriteMemory((ushort)(S-- + 0x100), (byte)PC);
			FlagB = type == ExceptionType.BRK;
			WriteMemory((ushort)(S-- + 0x100), P);
			FlagI = true;
			switch (type)
			{
				case ExceptionType.NMI:
					PC = ReadWord(NMIVector);
					break;
				case ExceptionType.IRQ:
					PC = ReadWord(IRQVector);
					break;
				case ExceptionType.BRK:
					PC = ReadWord(BRKVector);
					break;
				default: throw new Exception();
			}
			PendingCycles -= 7;
		}
コード例 #24
0
        public ExceptionForm(ExceptionType type, string title, string message, string stackTrace, bool continueButton)
        {
            InitializeComponent();

            this.Text = title;
            this.exceptionMessage.Text = message;
            this.stackTrace.Text = stackTrace;

            if (type == ExceptionType.Unhandled)
            {
                if (continueButton == false)
                {
                    this.continueButton.Visible = false;
                    this.quitButton.Location = this.continueButton.Location;
                }

                this.label.Text = Localization.Text_UnhandledException;
            }
            else if (type == ExceptionType.Handled)
            {
                this.quitButton.Visible = false;
                this.label.Text = Localization.Text_HandledException;
            }
        }
 public UserRegistrationCustomException(ExceptionType Type, string messgae) : base(messgae)
 {
     this.type = Type;
 }
コード例 #26
0
 public OtherType2(Int32 first, Int64 second, ExceptionType exType)
 {
     m_struct.First  = first;
     m_struct.Second = second;
     m_exType        = exType;
 }
コード例 #27
0
 public TApplicationException(ExceptionType type, string message)
     : base(message)
 {
     this.type = type;
 }
コード例 #28
0
        //public DataAccessException(Exception original, ExceptionType type, string messaginfo)
        //    : base(original, type, messaginfo)
        //{

        //}


        public DataAccessException(ExceptionType type, string messaginfo)
            : base(type, messaginfo)
        {
        }
コード例 #29
0
 public static extern IntPtr PixelGetIteratorException(IntPtr pixelIterator1, ref ExceptionType exType2);
コード例 #30
0
 public static extern IntPtr DrawGetException(IntPtr drawingWand1, ref ExceptionType exType2);
コード例 #31
0
 internal static Exception CreateInvalidSurrogatePairException(char low, char hi, ExceptionType exceptionType)
 {
     return(CreateInvalidSurrogatePairException(low, hi, exceptionType, 0, 0));
 }
コード例 #32
0
 internal static Exception CreateException(string res, string[] args, ExceptionType exceptionType)
 {
     return(CreateException(res, args, exceptionType, 0, 0));
 }
コード例 #33
0
        internal static void VerifyCharData(string data, ExceptionType invCharExceptionType, ExceptionType invSurrogateExceptionType)
        {
            if (data == null || data.Length == 0)
            {
                return;
            }

            int i   = 0;
            int len = data.Length;

            for (;;)
            {
                while (i < len && s_xmlCharType.IsCharData(data[i]))
                {
                    i++;
                }
                if (i == len)
                {
                    return;
                }

                char ch = data[i];
                if (XmlCharType.IsHighSurrogate(ch))
                {
                    if (i + 1 == len)
                    {
                        throw CreateException(SR.Xml_InvalidSurrogateMissingLowChar, invSurrogateExceptionType, 0, i + 1);
                    }
                    ch = data[i + 1];
                    if (XmlCharType.IsLowSurrogate(ch))
                    {
                        i += 2;
                        continue;
                    }
                    else
                    {
                        throw CreateInvalidSurrogatePairException(data[i + 1], data[i], invSurrogateExceptionType, 0, i + 1);
                    }
                }
                throw CreateInvalidCharException(data, i, invCharExceptionType);
            }
        }
コード例 #34
0
 internal static void VerifyCharData(string data, ExceptionType exceptionType)
 {
     VerifyCharData(data, exceptionType, exceptionType);
 }
コード例 #35
0
 public MoodAnalyserException(ExceptionType Type, String message) : base(message)
 {
     this.type = Type;
 }
コード例 #36
0
        /// <summary>
        /// Called when an exception occurs.
        /// </summary>
        /// <param name="context">The exception context.</param>
        public override void OnException(ExceptionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (context.Exception != null)
            {
                Logger?.WriteErrorLog(context.Exception);
            }

            //If exception handled before, do nothing.
            //If this is child action, exception should be handled by main action.
            if (context.ExceptionHandled || context.IsChildAction)
            {
                return;
            }

            //Always log exception
            //LogHelper.LogException(Logger, context.Exception);

            //var logger = IocManager.Instance.Resolve<ILogAppService>();
            //var session = IocManager.Instance.IocContainer.Resolve<ISession>();
            //var webprovider = IocManager.Instance.IocContainer.Resolve<IAuditInfoProvider>();

            //var auditInfo = new AuditInfo();
            //webprovider.Fill(auditInfo);

            //logger.Info(new AuditInfo { Exception = context.Exception, ExecutionTime = DateTime.Now, ServiceName = context.Controller.ControllerContext.RouteData.Values["controller"].ToString(), MethodName = context.Controller.ControllerContext.RouteData.Values["action"].ToString(), UserId = session.UserId });
            //// If custom errors are disabled, we need to let the normal ASP.NET exception handler
            // execute so that the user can see useful debugging information.
            if (!context.HttpContext.IsCustomErrorEnabled)
            {
                return;
            }

            // If this is not an HTTP 500 (for example, if somebody throws an HTTP 404 from an action method),
            // ignore it.
            if (new HttpException(null, context.Exception).GetHttpCode() != 500)
            {
                return;
            }

            //Do not handle exceptions for attributes configured for special exception types and this exceptiod does not fit condition.
            if (!ExceptionType.IsInstanceOfType(context.Exception))
            {
                return;
            }


            //We handled the exception!
            context.ExceptionHandled = true;

            //Return a special error response to the client.
            context.HttpContext.Response.Clear();
            context.Result = IsAjaxRequest(context)
                ? GenerateAjaxResult(context)
                : GenerateNonAjaxResult(context);

            // Certain versions of IIS will sometimes use their own error page when
            // they detect a server error. Setting this property indicates that we
            // want it to try to render ASP.NET MVC's error page instead.
            context.HttpContext.Response.TrySkipIisCustomErrors = true;

            //Trigger an event, so we can register it.
            //EventBus.Trigger(this, new HandledExceptionData(context.Exception));
        }
コード例 #37
0
        public static Exception CreateException(string exceptionCode, string message, ExceptionType exceptionType, Exception innerException)
        {
            Exception newEx = new Exception(message, innerException);

            newEx.Data.Add(SeifaeiBrothersException.cntKeyNameExceptionID, exceptionCode);
            newEx.Data.Add(SeifaeiBrothersException.cntKeyExceptionType, exceptionType);
            return(newEx);
        }
コード例 #38
0
 public static extern IntPtr GetWandViewException(IntPtr wandView1, ref ExceptionType exType2);
コード例 #39
0
        //public ParserException(Exception original, ExceptionType type, string messaginfo)
        //    : base(original, type, messaginfo)
        //{

        //}
        public ParserException(ExceptionType type, string messaginfo)
            : base(type, messaginfo)
        {
        }
コード例 #40
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:StylesSheetException"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="stylesSheetFilePath">The styles sheet file path.</param>
 public StylesSheetException(ExceptionType type, string stylesSheetFilePath)
 {
     this.type            = type;
     _stylesSheetFilePath = stylesSheetFilePath;
 }
コード例 #41
0
        //public ServiceException(Exception original, ExceptionType type, string messaginfo)
        //    : base(original, type, messaginfo)
        //{

        //}

        public ServiceException(ExceptionType type, string messaginfo)
            : base(type, messaginfo)
        {
        }
コード例 #42
0
 internal static Exception CreateInvalidCharException(char invChar, char nextChar, ExceptionType exceptionType)
 {
     return(CreateException(SR.Xml_InvalidCharacter, XmlException.BuildCharExceptionArgs(invChar, nextChar), exceptionType));
 }
コード例 #43
0
        //public SecurityException(Exception original, ExceptionType type, string messaginfo)
        //    : base(original, type, messaginfo)
        //{

        //}

        public SecurityException(ExceptionType type, string messaginfo)
            : base(type, messaginfo)
        {
        }
コード例 #44
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:StylesSheetException"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 public StylesSheetException(ExceptionType type)
 {
     this.type = type;
 }
コード例 #45
0
 public TApplicationException(ExceptionType type)
 {
     this.type = type;
 }
コード例 #46
0
 public AppException(ExceptionType type, Exception ex) : base("Application exception.", ex)
 {
     _type = type;
 }
コード例 #47
0
 public override int GetHashCode()
 => HashUtilities.Combine(InterproceduralCallStack,
                          HashUtilities.Combine(BasicBlockOrdinal.GetHashCodeOrDefault(),
                                                HashUtilities.Combine(HandlingCatchRegion.GetHashCodeOrDefault(),
                                                                      HashUtilities.Combine(ContainingFinallyRegion.GetHashCodeOrDefault(),
                                                                                            HashUtilities.Combine(ExceptionType.GetHashCode(), IsDefaultExceptionForExceptionsPathAnalysis.GetHashCode())))));
コード例 #48
0
 public AppException(ExceptionType type)
 {
     _type = type;
 }
コード例 #49
0
 public OtherType2()
 {
     m_exType = ExceptionType.None;
 }
コード例 #50
0
 public MoodAnalysisException(ExceptionType Type, string message) : base(message)
 {
     this.ExceptType = Type;
 }
コード例 #51
0
 public CabInvoiceException(string message, ExceptionType type)
     : base(message)
 {
     this.type = type;
 }
コード例 #52
0
        //public CommonException(Exception original, ExceptionType type, string messaginfo)
        //    : base(original, type, messaginfo)
        //{

        //}
        public CommonException(ExceptionType type, string messaginfo)
            : base(type, messaginfo)
        {
        }
コード例 #53
0
 internal static Exception CreateInvalidSurrogatePairException(char low, char hi, ExceptionType exceptionType, int lineNo, int linePos)
 {
     string[] args = new string[] {
         ((uint)hi).ToString("X", CultureInfo.InvariantCulture),
         ((uint)low).ToString("X", CultureInfo.InvariantCulture)
     };
     return(CreateException(SR.Xml_InvalidSurrogatePairWithArgs, args, exceptionType, lineNo, linePos));
 }
コード例 #54
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:StylesSheetException"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 public StylesSheetException(ExceptionType type, Exception innerException)
 {
     this.type = type;
     this.innerExceptionMessage = innerException.ToString();
 }
コード例 #55
0
 public static extern IntPtr MagickGetException(IntPtr magickWand1, ref ExceptionType exType2);
コード例 #56
0
 internal static Exception CreateInvalidHighSurrogateCharException(char hi, ExceptionType exceptionType)
 {
     return(CreateInvalidHighSurrogateCharException(hi, exceptionType, 0, 0));
 }
コード例 #57
0
 public static extern IntPtr PixelGetException(IntPtr pixelWand1, ref ExceptionType exType2);
コード例 #58
0
 internal static Exception CreateInvalidHighSurrogateCharException(char hi, ExceptionType exceptionType, int lineNo, int linePos)
 {
     return(CreateException(SR.Xml_InvalidSurrogateHighChar, ((uint)hi).ToString("X", CultureInfo.InvariantCulture), exceptionType, lineNo, linePos));
 }
コード例 #59
0
        public Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[1];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __HandleException_1 __ctx1__ = (__HandleException_1)_stateMgrs[1];
            __HandleException_root_0 __ctx0__ = (__HandleException_root_0)_stateMgrs[0];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx1__.__errorCode = (System.Int32)Args[0];
                __ctx1__.__ExceptionDescription = (System.String)Args[3];
                __ctx1__.__InnerExceptionDescription = (System.String)Args[4];
                __ctx1__.__Context = new __messagetype_System_Xml_XmlDocument("Context", __ctx1__);
                __ctx1__.__Context.CopyFrom((Microsoft.XLANGs.Core.XMessage)Args[1]);
                __ctx1__.RefMessage(__ctx1__.__Context);
                __ctx1__.__Context.ConstructionCompleteEvent();
                __ctx1__.__ErrMsg = new __messagetype_System_Xml_XmlDocument("ErrMsg", __ctx1__);
                __ctx1__.__ErrMsg.CopyFrom((Microsoft.XLANGs.Core.XMessage)Args[2]);
                __ctx1__.RefMessage(__ctx1__.__ErrMsg);
                __ctx1__.__ErrMsg.ConstructionCompleteEvent();
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[1],__eventData[1],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[2],__eventData[2],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                System.Diagnostics.EventLog.WriteEntry("RIZIV-INAMI.MedegaImport", System.String.Format("An error occured! Error code returned : {0}\r\nDescription: {1}\r\nInnerException: {2}", __ctx1__.__errorCode, __ctx1__.__ExceptionDescription, __ctx1__.__InnerExceptionDescription), System.Diagnostics.EventLogEntryType.Error);
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                if ( !PreProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[3],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 6;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[4],__eventData[4],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                {
                    ExceptionType __MailError = new ExceptionType("MailError", __ctx1__);

                    __MailError.Context.CopyFrom(__ctx1__.__Context.part);
                    __MailError.ErrMsg.CopyFrom(__ctx1__.__ErrMsg.part);
                    __MailError.ErrText.LoadFrom("Error: " + __ctx1__.__ExceptionDescription + "\n" + __ctx1__.__InnerExceptionDescription);
                    if (__ctx1__ != null)
                        __ctx1__.__InnerExceptionDescription = null;
                    if (__ctx1__ != null)
                        __ctx1__.__ExceptionDescription = null;

                    if (__ctx1__.__MailError != null)
                        __ctx1__.UnrefMessage(__ctx1__.__MailError);
                    __ctx1__.__MailError = __MailError;
                    __ctx1__.RefMessage(__ctx1__.__MailError);
                }
                __ctx1__.__MailError.ConstructionCompleteEvent(false);
                if ( !PostProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx1__.__MailError);
                    Tracker.FireEvent(__eventLocations[5],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 9;
            case 9:
                if ( !PreProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[6],__eventData[5],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 10;
            case 10:
                if (!__ctx1__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 11;
            case 11:
                if ( !PreProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                SendErrContext.SendMessage(0, __ctx1__.__MailError, null, null, __ctx1__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.None );
                if (SendErrContext != null)
                {
                    SendErrContext.Close(__ctx1__, __seg__);
                    SendErrContext = null;
                }
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingRqst) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingRqst;
                goto case 12;
            case 12:
                if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Send);
                    __edata.Messages.Add(__ctx1__.__MailError);
                    __edata.PortName = @"SendErrContext";
                    Tracker.FireEvent(__eventLocations[7],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (__ctx1__ != null && __ctx1__.__MailError != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__MailError);
                    __ctx1__.__MailError = null;
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 13;
            case 13:
                if ( !PreProgressInc( __seg__, __ctx__, 14 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[8],__eventData[5],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 14;
            case 14:
                if (!__ctx1__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 15;
            case 15:
                if ( !PreProgressInc( __seg__, __ctx__, 16 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                SendErrMsg.SendMessage(0, __ctx1__.__ErrMsg, null, null, __ctx1__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.NextActivityPersists );
                if (SendErrMsg != null)
                {
                    SendErrMsg.Close(__ctx1__, __seg__);
                    SendErrMsg = null;
                }
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingRqst) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingRqst;
                goto case 16;
            case 16:
                if ( !PreProgressInc( __seg__, __ctx__, 17 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Send);
                    __edata.Messages.Add(__ctx1__.__ErrMsg);
                    __edata.PortName = @"SendErrMsg";
                    Tracker.FireEvent(__eventLocations[9],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 17;
            case 17:
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Body);
                    __edata.Messages.Add(__ctx1__.__Context);
                    __edata.Messages.Add(__ctx1__.__ErrMsg);
                    Tracker.FireEvent(__eventLocations[0],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (__ctx1__ != null && __ctx1__.__ErrMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__ErrMsg);
                    __ctx1__.__ErrMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__Context != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__Context);
                    __ctx1__.__Context = null;
                }
                if ( !PostProgressInc( __seg__, __ctx__, 18 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 18;
            case 18:
                if (!__ctx1__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 19 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 19;
            case 19:
                if ( !PreProgressInc( __seg__, __ctx__, 20 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx1__.OnCommit();
                goto case 20;
            case 20:
                Args[0] = __ctx1__.__errorCode;
                if ( !PostProgressInc( __seg__, __ctx__, 21 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 21;
            case 21:
                __seg__.SegmentDone();
                _segments[0].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }
コード例 #60
0
 internal static Exception CreateInvalidCharException(string data, int invCharPos, ExceptionType exceptionType)
 {
     return(CreateException(SR.Xml_InvalidCharacter, XmlException.BuildCharExceptionArgs(data, invCharPos), exceptionType, 0, invCharPos + 1));
 }