/// <summary> /// Handles the exception. Throws an exception based on the error. /// </summary> /// <param name="error">The error to check.</param> /// <param name="methodName">Method name</param> private void handleException(ASIOError error, String methodName) { if (error != ASIOError.ASE_OK && error != ASIOError.ASE_SUCCESS) { ASIOException asioException = new ASIOException(String.Format("Error code [{0}] while calling ASIO method <{1}>, {2}", ASIOException.getErrorName(error), methodName, this.getErrorMessage())); asioException.Error = error; throw asioException; } }
public AsioException(ASIOError Error) : base(String.Format("Error in ASIO object: {0}", Error)) { error = Error; }
/// <summary> /// Gets the name of the error. /// </summary> /// <param name="error">The error.</param> /// <returns>the name of the error</returns> static public String getErrorName(ASIOError error) { return Enum.GetName(typeof(ASIOError), error); }
/// <summary> /// Gets the name of the error. /// </summary> /// <param name="error">The error.</param> /// <returns>the name of the error</returns> static public String getErrorName(ASIOError error) { return(Enum.GetName(typeof(ASIOError), error)); }
private static void Try(ASIOError Result) { if (Result != ASIOError.OK && Result != ASIOError.SUCCESS) throw new AsioException(Result); }
public AsioException(string Message, ASIOError Error) : base(Message) { error = Error; }