private static string FromBrokerApiException(BrokerApiErrorException ex) { switch (ex.ApiError) { case BrokerApiError.NoRInterpreters: return(Resources.Error_NoRInterpreters); case BrokerApiError.InterpreterNotFound: return(Resources.Error_InterpreterNotFound); case BrokerApiError.UnableToStartRHost: if (!string.IsNullOrEmpty(ex.Message)) { return(Resources.Error_UnableToStartHostException.FormatInvariant(ex.Message)); } return(Resources.Error_UnknownError); case BrokerApiError.PipeAlreadyConnected: return(Resources.Error_PipeAlreadyConnected); case BrokerApiError.BrokerMaxUsers: return(Resources.Error_MaxUsersAllowed.FormatInvariant(ex.Message)); } Debug.Fail("No localized resources for broker API error" + ex.ApiError.ToString()); return(ex.ApiError.ToString()); }
public RHostDisconnectedException(BrokerApiErrorException ex) : base(FromBrokerApiException(ex), ex) { }