public static NMSException Create(Exception cause)
{
if(cause is NMSException)
{
return (NMSException) cause;
}
string msg = cause.Message;
if(msg == null || msg.Length == 0)
{
msg = cause.ToString();
}
NMSException exception = new NMSException(msg, cause);
return exception;
}