private void checkForErrors(XmlDocument document) { XmlNode n = document.GetElementsByTagName("lfm")[0]; string status = n.Attributes[0].InnerText; if (status == "failed") { XmlNode err = document.GetElementsByTagName("error")[0]; ServiceExceptionType type = (ServiceExceptionType)Convert.ToInt32(err.Attributes[0].InnerText); string description = err.InnerText; } }
private static string ExceptionTypeToString(ServiceExceptionType exceptionType) { switch (exceptionType) { case ServiceExceptionType.UserAlreadyExist: return("User already exist"); case ServiceExceptionType.NotEnoughtBalance: return("Not enought balance"); case ServiceExceptionType.EntityNotFound: return("Entity not found"); default: throw new NotSupportedException(); } }
public ServiceException(ServiceExceptionType type, string description) : base() { this.Type = type; this.Description = description; }
public ServiceException(string message, Exception innerException, ServiceExceptionType type, [CallerMemberName] string name = "", [CallerLineNumber] int line = -1, [CallerFilePath] string path = "") : base(message, innerException) { CreateCode(name, line, path); }
public ServiceException(ServiceExceptionType type, [CallerMemberName] string name = "", [CallerLineNumber] int line = -1, [CallerFilePath] string path = "") { Type = type; CreateCode(name, line, path); }
public ServiceException(ServiceExceptionType type) { Type = type; }
public ServiceException(ServiceExceptionType type, string message = null, Exception innerException = null) : base(message, innerException) { _type = type; }
public ServiceException(string dubugInfo, ServiceExceptionType exceptionType) { this.DebugInfo = dubugInfo; this.ExceptionType = exceptionType; }
public ServiceException(ServiceExceptionType exceptionType) : this(ExceptionTypeToString(exceptionType), exceptionType) { ServiceExceptionType = exceptionType; }
public ServiceException(string message, ServiceExceptionType exceptionType) : base(message) { ServiceExceptionType = exceptionType; }
public ServiceException(string msg, ServiceExceptionType type) : base(msg) => Type = type;
public ServiceException(ServiceExceptionType type, string message) : this(type, message, null) { }
public ServiceException(ServiceExceptionType type, string message, Exception innerException) : base(message, innerException) { Type = type; }
public ServiceException(Exception innerException, ServiceExceptionType exceptionType) { InnerException = innerException; ExceptionType = exceptionType; }