Fixed the licensing statements - I had erroneously marked the files as covered by...
[lwes-dotnet/github-mirror.git] / Org.Lwes / Exceptions.cs
blob6653bed0192327684688e236597072443c77316c
1 //
2 // This file is part of the LWES .NET Binding (LWES.net)
3 //
4 // COPYRIGHT (C) 2009, Phillip Clark (cerebralkungfu[at*g mail[dot*com)
5 // original .NET implementation
6 //
7 // LWES.net is free software: you can redistribute it and/or modify
8 // it under the terms of the Lesser GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // LWES.net is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the Lesser GNU General Public License
18 // along with LWES.net. If not, see <http://www.gnu.org/licenses/>.
20 namespace Org.Lwes
22 using System;
23 using System.Runtime.Serialization;
25 /// <summary>
26 /// Exception indicating that an attribute was not set.
27 /// </summary>
28 [Serializable]
29 public class AttributeNotSetException : EventSystemException
31 #region Constructors
33 /// <summary>
34 /// Creates a new instance and initializes the error message.
35 /// </summary>
36 /// <param name="errorMessage">an error message</param>
37 public AttributeNotSetException(string errorMessage)
38 : base(errorMessage)
42 AttributeNotSetException(SerializationInfo info, StreamingContext context)
43 : base(info, context)
47 #endregion Constructors
50 /// <summary>
51 /// Exception thrown when bad data is encountered during serialization.
52 /// </summary>
53 [Serializable]
54 public class BadLwesDataException : EventSystemException
56 #region Constructors
58 /// <summary>
59 /// Creates a new instance.
60 /// </summary>
61 /// <param name="errorMessage">error message</param>
62 public BadLwesDataException(string errorMessage)
63 : base(errorMessage)
67 /// <summary>
68 /// Creates a new instance from serialization.
69 /// </summary>
70 /// <param name="info"></param>
71 /// <param name="context"></param>
72 public BadLwesDataException(SerializationInfo info, StreamingContext context)
73 : base(info, context)
77 #endregion Constructors
80 /// <summary>
81 /// Base class for exceptions thrown by the event system.
82 /// </summary>
83 [Serializable]
84 public class EventSystemException : Exception
86 #region Constructors
88 /// <summary>
89 /// Creates a new instance.
90 /// </summary>
91 /// <param name="errorMessage">error message</param>
92 public EventSystemException(string errorMessage)
93 : base(errorMessage)
97 /// <summary>
98 /// Creates a new instance.
99 /// </summary>
100 /// <param name="errorMessage">error message</param>
101 /// <param name="innerException">exception that caused this exception</param>
102 public EventSystemException(string errorMessage, Exception innerException)
103 : base(errorMessage, innerException)
107 /// <summary>
108 /// Creates a new instance from serialization.
109 /// </summary>
110 /// <param name="info"></param>
111 /// <param name="context"></param>
112 public EventSystemException(SerializationInfo info, StreamingContext context)
113 : base(info, context)
117 #endregion Constructors
120 /// <summary>
121 /// Exception thrown when an attriubte does not exist in an Event.
122 /// </summary>
123 [Serializable]
124 public class NoSuchAttributeException : EventSystemException
126 #region Constructors
128 /// <summary>
129 /// Creates a new instance.
130 /// </summary>
131 /// <param name="errorMessage">error message</param>
132 public NoSuchAttributeException(string errorMessage)
133 : base(errorMessage)
137 /// <summary>
138 /// Creates a new instance from serialization.
139 /// </summary>
140 /// <param name="info"></param>
141 /// <param name="context"></param>
142 public NoSuchAttributeException(SerializationInfo info, StreamingContext context)
143 : base(info, context)
147 #endregion Constructors
150 /// <summary>
151 /// Exception thrown when an attribute type does not exist.
152 /// </summary>
153 [Serializable]
154 public class NoSuchAttributeTypeException : EventSystemException
156 #region Constructors
158 /// <summary>
159 /// Creates a new instance.
160 /// </summary>
161 /// <param name="errorMessage">error message</param>
162 public NoSuchAttributeTypeException(string errorMessage)
163 : base(errorMessage)
167 /// <summary>
168 /// Creates a new instance from serialization.
169 /// </summary>
170 /// <param name="info"></param>
171 /// <param name="context"></param>
172 public NoSuchAttributeTypeException(SerializationInfo info, StreamingContext context)
173 : base(info, context)
177 #endregion Constructors