summaryrefslogtreecommitdiff
path: root/NetException.cs
diff options
context:
space:
mode:
Diffstat (limited to 'NetException.cs')
-rw-r--r--NetException.cs91
1 files changed, 91 insertions, 0 deletions
diff --git a/NetException.cs b/NetException.cs
new file mode 100644
index 0000000..b750b2b
--- /dev/null
+++ b/NetException.cs
@@ -0,0 +1,91 @@
+// Noddybox.Net - Provides simple server interaction classes
+// Copyright (C) 2003 Ian Cowburn
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// $Id$
+//
+
+namespace Noddybox.Net
+{
+ using System;
+
+ /// <summary>
+ /// Exception raised for internal problems.
+ /// </summary>
+ /// <remarks>
+ /// created by - ianc
+ /// created on - 07/09/2003 23:42:00
+ /// </remarks>
+ public class NetException : System.Exception
+ {
+ /// <summary>
+ /// The types of error that can be raised
+ /// </summary>
+ public enum Type
+ {
+ /// <summary>
+ /// A server replied with no code in the first reply line
+ /// </summary>
+ ALL_NoReplyCode,
+
+ /// <summary>
+ /// The local IP address could not be found (note that all
+ /// the routines use the first available IP when onew must
+ /// be chosen).
+ /// </summary>
+ ALL_NoLocalIP,
+
+ /// <summary>
+ /// An uncompleted feature was used
+ /// </summary>
+ ALL_NotImplemented,
+
+ /// <summary>
+ /// The FTP server does not support passive connections
+ /// </summary>
+ FTP_NoPassive,
+
+ /// <summary>
+ /// The FTP server had a problem accepting our local port
+ /// info
+ /// </summary>
+ FTP_NonPassiveProblem,
+
+ /// <summary>
+ /// Given a bad address by the server
+ /// </summary>
+ FTP_BadReplyAddress
+ };
+
+ /// <summary>
+ /// Default constructor - initializes all fields to default values
+ /// </summary>
+ public NetException(Type e)
+ {
+ m_code=e;
+ }
+
+ /// <summary>
+ /// Gets the cause of the error
+ /// </summary>
+ public Type Error
+ {
+ get {return m_code;}
+ }
+
+ private Type m_code;
+ }
+}