* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / ByteFX.Data / mysqlclient / Exception.cs
1 // ByteFX.Data data access components for .Net\r
2 // Copyright (C) 2002-2003  ByteFX, Inc.\r
3 //\r
4 // This library is free software; you can redistribute it and/or\r
5 // modify it under the terms of the GNU Lesser General Public\r
6 // License as published by the Free Software Foundation; either\r
7 // version 2.1 of the License, or (at your option) any later version.\r
8 // \r
9 // This library is distributed in the hope that it will be useful,\r
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
12 // Lesser General Public License for more details.\r
13 // \r
14 // You should have received a copy of the GNU Lesser General Public\r
15 // License along with this library; if not, write to the Free Software\r
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
17 \r
18 using System;\r
19 using System.Runtime.Serialization;\r
20 \r
21 namespace ByteFX.Data.MySqlClient\r
22 {\r
23         /// <summary>\r
24         /// The exception that is thrown when MySQL returns an error. This class cannot be inherited.\r
25         /// </summary>\r
26         /// <include file='docs/MySqlException.xml' path='MyDocs/MyMembers[@name="Class"]/*'/>\r
27         [Serializable]\r
28         public sealed class MySqlException : SystemException\r
29         {\r
30                 private int     errorCode;\r
31 \r
32                 internal MySqlException(string msg) : base(msg)\r
33                 {\r
34                 }\r
35                 \r
36                 internal MySqlException( string msg, Exception ex ) : base(msg, ex)\r
37                 {\r
38                 }\r
39 \r
40                 internal MySqlException() \r
41                 {\r
42                 }\r
43 \r
44                 internal MySqlException(string msg, int errno) : base(msg)\r
45                 {\r
46                         errorCode = errno;      \r
47                 }\r
48 \r
49                 internal MySqlException(SerializationInfo info,\r
50                                         StreamingContext context) : base(info, context)\r
51                 {\r
52                 }\r
53 \r
54                 /// <summary>\r
55                 /// Gets a number that identifies the type of error.\r
56                 /// </summary>\r
57                 public int Number \r
58                 {\r
59                         get { return errorCode; }\r
60                 }\r
61 \r
62         }\r
63 }\r