Should custom exceptions have their own ErrorCode?
<p>I've got a socket wrapper library I've been working on that handles, among other things, a little handshake at the beginning to ensure whoever you're talking to is using the same protocol and settings as you. I created my own exception class the standard way:</p>

<pre><code> private class NSocketProtocolException : System.Exception
    {
        public NSocketProtocolException(string message) : base(message) { }
    }
</code></pre>

<p>I throw this exception for a variety of reasons, like, if the client and server aren't using the same version of the protocol, if one wants to use encryption and the other doesn't, etc. Right now I'm the only one who uses this library, but I was trying to design it to be friendly enough so that maybe in the future other people could. In order for other programmers to be able to do something more worthwhile with the different instances where the exception would be thrown, should I have my own custom error codes to go with these?</p>

<p>I don't really know how to edit the error code, but more importantly, I don't want to use the same error code that maybe another type of exception uses. Any thoughts?</p>
