/// <summary> /// Gets the error label text detail. /// </summary> /// <param name="value">The value.</param> private static string GetErrorLabelTextDetail(IAPIResult result) { switch (result.ErrorType) { case APIEnumerations.APIErrors.None: return("No error specified"); case APIEnumerations.APIErrors.CCP: return(String.Format(CultureConstants.DefaultCulture, "CCP Error {0} : {1}", result.CCPError.ErrorCode, result.CCPError.ErrorMessage)); case APIEnumerations.APIErrors.Http: return(String.Format(CultureConstants.DefaultCulture, "HTTP error: {0}", result.ErrorMessage)); case APIEnumerations.APIErrors.Xml: return(String.Format(CultureConstants.DefaultCulture, "XML error: {0}", result.ErrorMessage)); case APIEnumerations.APIErrors.Xslt: return(String.Format(CultureConstants.DefaultCulture, "XSLT error: {0}", result.ErrorMessage)); default: throw new NotImplementedException(); } }
/// <summary> /// Checks whether we should notify an error. /// </summary> /// <param name="result"></param> /// <param name="method"></param> /// <returns></returns> internal bool ShouldNotifyError(IAPIResult result, Enum method) { // Notify an error occurred if (result.HasError) { if (!m_errorNotifiedMethod.Equals(CCPAPIMethodsEnum.None)) { return(false); } m_errorNotifiedMethod = method; return(true); } // Removes the previous error notification if (!m_errorNotifiedMethod.Equals(method)) { return(false); } EveMonClient.Notifications.InvalidateCharacterAPIError(this); m_errorNotifiedMethod = CCPAPIMethodsEnum.None; return(false); }
private static void CheckForError(IAPIResult response) { if (response is ErrorResult) { var temp = (ErrorResult)response; throw new RPCException(temp.error); } }
/// <summary> /// Gets the XML data from the result. /// </summary> /// <param name="result">The result.</param> /// <returns></returns> private static string GetXmlData(IAPIResult result) { if (result == null || result.XmlDocument == null) { return("There was no associated XML document."); } return(Util.GetXmlStringRepresentation(result.XmlDocument)); }
/// <summary> /// Notifies EVE Backend Database is temporarily disabled. /// </summary> /// <param name="character"></param> /// <param name="result"></param> internal void NotifyEVEBackendDatabaseDisabled(IAPIResult result) { var notification = new APIErrorNotification(null, result) { Description = result.ErrorMessage, Behaviour = NotificationBehaviour.Overwrite, Priority = NotificationPriority.Error }; Notify(notification); }
/// <summary> /// Checks whether we should notify an error. /// </summary> /// <param name="result"></param> /// <param name="method"></param> /// <returns></returns> internal bool ShouldNotifyError(IAPIResult result, Enum method) { // Checks if EVE database is out of service if (result.EVEDatabaseError) { return(false); } // We don't want to be notified about corp roles error if (result.CCPError != null && result.CCPError.IsCorpRolesError) { return(false); } // We don't want to be notified about kill log exhausted error if (result.CCPError != null && result.CCPError.IsKillLogExhaustedError) { return(false); } // We don't want to be notified about not enlisted in factional warfare error if (result.CCPError != null && result.CCPError.IsFactionalWarfareEnlistedError) { return(false); } // Notify an error occurred if (result.HasError) { if (!m_errorNotifiedMethod.Equals(CCPAPIMethodsEnum.None)) { return(false); } m_errorNotifiedMethod = method; return(true); } // Removes the previous error notification if (!m_errorNotifiedMethod.Equals(method)) { return(false); } EveMonClient.Notifications.InvalidateCharacterAPIError(this); m_errorNotifiedMethod = CCPAPIMethodsEnum.None; return(false); }
/// <summary> /// Checks whether we should notify an error. /// </summary> /// <param name="result"></param> /// <returns></returns> private bool ShouldNotifyError(IAPIResult result, APIMethods method) { // Notify an error occured if (result.HasError) { if (m_errorNotifiedMethod != APIMethods.None) { return(false); } m_errorNotifiedMethod = method; return(true); } // Removes the previous error notification. if (m_errorNotifiedMethod == method) { EveClient.Notifications.InvalidateCharacterAPIError(this); m_errorNotifiedMethod = APIMethods.None; } return(false); }
/// <summary> /// Gets the error label text detail. /// </summary> /// <param name="result">The value.</param> private static string GetErrorLabelTextDetail(IAPIResult result) { switch (result.ErrorType) { case Common.Enumerations.CCPAPI.CCPAPIErrors.None: return("No error specified"); case Common.Enumerations.CCPAPI.CCPAPIErrors.CCP: return($"CCP Error {result.CCPError.ErrorCode} : {result.CCPError.ErrorMessage}"); case Common.Enumerations.CCPAPI.CCPAPIErrors.Http: return($"HTTP error: {result.ErrorMessage}"); case Common.Enumerations.CCPAPI.CCPAPIErrors.Xml: return($"XML error: {result.ErrorMessage}"); case Common.Enumerations.CCPAPI.CCPAPIErrors.Xslt: return($"XSLT error: {result.ErrorMessage}"); default: throw new NotImplementedException(); } }
/// <summary> /// Gets the error label text detail. /// </summary> /// <param name="result">The value.</param> private static string GetErrorLabelTextDetail(IAPIResult result) { switch (result.ErrorType) { case APIErrorType.None: return("No error specified"); case APIErrorType.CCP: return($"CCP Error: {result.ErrorMessage}"); case APIErrorType.Http: return($"HTTP error: {result.ErrorMessage}"); case APIErrorType.Xml: return($"XML error: {result.ErrorMessage}"); case APIErrorType.Json: return($"XSLT error: {result.ErrorMessage}"); default: throw new NotImplementedException(); } }
/// <summary> /// Checks whether we should notify an error. /// </summary> /// <param name="result"></param> /// <param name="method"></param> /// <returns></returns> internal bool ShouldNotifyError(IAPIResult result, Enum method) { // Checks if EVE database is out of service if (result.EVEDatabaseError) return false; // We don't want to be notified about corp roles error if (result.CCPError != null && result.CCPError.IsCorpRolesError) return false; // We don't want to be notified about kill log exhausted error if (result.CCPError != null && result.CCPError.IsKillLogExhaustedError) return false; // We don't want to be notified about not enlisted in factional warfare error if (result.CCPError != null && result.CCPError.IsFactionalWarfareEnlistedError) return false; // Notify an error occurred if (result.HasError) { if (!m_errorNotifiedMethod.Equals(CCPAPIMethodsEnum.None)) return false; m_errorNotifiedMethod = method; return true; } // Removes the previous error notification if (!m_errorNotifiedMethod.Equals(method)) return false; EveMonClient.Notifications.InvalidateCharacterAPIError(this); m_errorNotifiedMethod = CCPAPIMethodsEnum.None; return false; }
/// <summary> /// Constructor. /// </summary> /// <param name="sender">The sender.</param> /// <param name="result">The result.</param> public APIErrorNotificationEventArgs(object sender, IAPIResult result) : base(sender, NotificationCategory.QueryingError) { Result = result; }
public static DataNode FromAPIResult(IAPIResult input) { return(FromObject(input, null)); }
/// <summary> /// Checks whether the query must be retrieved with CCP as the default provider. /// </summary> /// <param name="result"></param> /// <returns></returns> private bool ShouldRetryWithCCP(IAPIResult result) => s_ccpProvider != this && s_ccpTestProvider != this && result.HasError && result.ErrorType != CCPAPIErrors.CCP;
/// <summary> /// Checks whether we should notify an error. /// </summary> /// <param name="result"></param> /// <param name="method"></param> /// <returns></returns> internal bool ShouldNotifyError(IAPIResult result, APIMethods method) { // Notify an error occurred if (result.HasError) { // Checks if EVE Backend Database is temporarily disabled if (result.EVEBackendDatabaseDisabled) return false; if (m_errorNotifiedMethod != APIMethods.None) return false; m_errorNotifiedMethod = method; return true; } // Removes the previous error notification if (m_errorNotifiedMethod == method) { EveClient.Notifications.InvalidateCharacterAPIError(this); m_errorNotifiedMethod = APIMethods.None; } return false; }
/// <summary> /// Gets the error label text detail. /// </summary> /// <param name="result">The value.</param> private static string GetErrorLabelTextDetail(IAPIResult result) { switch (result.ErrorType) { case Common.Enumerations.CCPAPI.CCPAPIErrors.None: return "No error specified"; case Common.Enumerations.CCPAPI.CCPAPIErrors.CCP: return $"CCP Error {result.CCPError.ErrorCode} : {result.CCPError.ErrorMessage}"; case Common.Enumerations.CCPAPI.CCPAPIErrors.Http: return $"HTTP error: {result.ErrorMessage}"; case Common.Enumerations.CCPAPI.CCPAPIErrors.Xml: return $"XML error: {result.ErrorMessage}"; case Common.Enumerations.CCPAPI.CCPAPIErrors.Xslt: return $"XSLT error: {result.ErrorMessage}"; default: throw new NotImplementedException(); } }
/// <summary> /// Gets the XML data from the result. /// </summary> /// <param name="result">The result.</param> /// <returns></returns> private static string GetXmlData(IAPIResult result) { if (result == null || result.XmlDocument == null) return "There was no associated XML document."; return Util.GetXmlStringRepresentation(result.XmlDocument); }
/// <summary> /// Constructor. /// </summary> /// <param name="category"></param> /// <param name="sender"></param> public APIErrorNotification(Object sender, IAPIResult result) : base(NotificationCategory.QueryingError, sender) { m_result = result; }
/// <summary> /// Gets the error label text detail. /// </summary> /// <param name="value">The value.</param> private static string GetErrorLabelTextDetail(IAPIResult result) { switch (result.ErrorType) { case APIEnumerations.APIErrors.None: return "No error specified"; case APIEnumerations.APIErrors.CCP: return String.Format(CultureConstants.DefaultCulture, "CCP Error {0} : {1}", result.CCPError.ErrorCode, result.CCPError.ErrorMessage); case APIEnumerations.APIErrors.Http: return String.Format(CultureConstants.DefaultCulture, "HTTP error: {0}", result.ErrorMessage); case APIEnumerations.APIErrors.Xml: return String.Format(CultureConstants.DefaultCulture, "XML error: {0}", result.ErrorMessage); case APIEnumerations.APIErrors.Xslt: return String.Format(CultureConstants.DefaultCulture, "XSLT error: {0}", result.ErrorMessage); default: throw new NotImplementedException(); } }
/// <summary> /// Constructor. /// </summary> /// <param name="sender">The sender.</param> /// <param name="result">The result.</param> public APIErrorNotificationEventArgs(Object sender, IAPIResult result) : base(sender, NotificationCategory.QueryingError) { Result = result; }
/// <summary> /// Checks whether the query must be retrieved with CCP as the default provider. /// </summary> /// <param name="result"></param> /// <returns></returns> private bool ShouldRetryWithCCP(IAPIResult result) { return(s_ccpProvider != this && s_ccpTestProvider != this && result.HasError && result.ErrorType != APIEnumerations.APIErrors.CCP); }