[or-cvs] Add C# controller lib port from Oliver Rau.

Nick Mathewson nickm at seul.org
Wed Nov 9 21:47:06 UTC 2005


Update of /home/or/cvsroot/control/cs/control/Exceptions
In directory moria:/tmp/cvs-serv5623/control/Exceptions

Added Files:
	TorControlException.cs TorControlSyntaxException.cs 
Log Message:
Add C# controller lib port from Oliver Rau.

--- NEW FILE: TorControlException.cs ---
/*
 * File TorControlException.cs
 * 
 * Copyright (C) 2005 Oliver Rau (olra0001 at student-zw.fh-kl.de)
 * 
 * See LICENSE file for copying information 
 * 
 * Created on 08.08.2005 20:37
 * 
 * $Id: TorControlException.cs,v 1.1 2005/11/09 21:47:04 nickm Exp $
 */

using System;

namespace Tor.Control
{
	/// <summary>
	/// Description of TorControlException.
	/// </summary>
	public class TorControlException : Exception
	{
		int errorType;
		public TorControlException(int type, String s) : base(s)
		{
			errorType = type;
		}
		
		public TorControlException(string s) : this(-1, s)
		{
		}
		
		public int ErrorType {
			get { return errorType; }
		}
		
		public string ErrorMsg {
			get {
				try {
					if (errorType == -1)
						return null;
					
					return TorControl.ErrorMsgs[errorType];
				} catch (IndexOutOfRangeException ex) {
					return "Unrecognized error #" + errorType;
				}
			}
		}
	}
}

--- NEW FILE: TorControlSyntaxException.cs ---
/*
 * File TorControlSyntaxException.cs
 * 
 * Copyright (C) 2005 Oliver Rau (olra0001 at student-zw.fh-kl.de)
 * 
 * See LICENSE file for copying information 
 * 
 * Created on 08.08.2005 20:37
 * 
 * $Id: TorControlSyntaxException.cs,v 1.1 2005/11/09 21:47:04 nickm Exp $
 */

using System;

namespace Tor.Control
{
	/// <summary>
	/// Description of TorControlSyntaxException.
	/// </summary>
	public class TorControlSyntaxException : Exception
	{
		public TorControlSyntaxException(string s) : base(s)
		{}
	}
}



More information about the tor-commits mailing list