类 TokenManagementException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cn.isliu.core.exception.FsHelperException
cn.isliu.core.exception.TokenManagementException
- 所有已实现的接口:
Serializable
Token management exception class
Specialized exception for handling various error scenarios during tenant_access_token management,
including token fetch failures, parsing errors, cache operation failures, etc.
- 作者:
- isliu
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 cn.isliu.core.exception.FsHelperException
FsHelperException.Builder -
构造器概要
构造器构造器说明TokenManagementException(ErrorCode errorCode, String message) Constructor - specifies specific error codeTokenManagementException(ErrorCode errorCode, String message, Throwable cause) Constructor - specifies specific error code with causeConstructor - includes context informationTokenManagementException(ErrorCode errorCode, String message, Map<String, Object> context, Throwable cause) Constructor - full parametersTokenManagementException(String message) Constructor - uses default TOKEN_MANAGEMENT_ERROR error codeTokenManagementException(String message, Throwable cause) Constructor - uses default TOKEN_MANAGEMENT_ERROR error code with cause -
方法概要
修饰符和类型方法说明longgetSuggestedRetryDelay(int retryCount) Get suggested retry delay time in millisecondsGet user-friendly error messagebooleanCheck if this is an API response-related exceptionbooleanCheck if this is a cache-related exceptionbooleanCheck if this is a network-related token management exceptionstatic TokenManagementExceptiontokenCacheError(String message, Throwable cause) Create token cache operation failed exceptionstatic TokenManagementExceptiontokenFetchFailed(String message, Throwable cause) Create token fetch failed exceptionstatic TokenManagementExceptiontokenFetchFailedWithApiInfo(String message, int apiCode, String apiMessage) Create token fetch failed exception with API response infostatic TokenManagementExceptiontokenParseError(String message, String responseBody) Create token parse error exceptionstatic TokenManagementExceptiontokenRefreshFailed(String message, Throwable cause) Create token refresh failed exceptionstatic TokenManagementExceptionwithRetryInfo(ErrorCode errorCode, String message, int retryCount, int maxRetries, Throwable cause) Create token management exception with retry information从类继承的方法 cn.isliu.core.exception.FsHelperException
addContext, addContext, builder, getContext, getContextValue, getDetailedInfo, getErrorCode, getExceptionChain, getExceptionId, getRootCause, getTimestamp, hasContextKey, isClientError, isFatal, isRetryable, isServerError
-
构造器详细资料
-
TokenManagementException
Constructor - uses default TOKEN_MANAGEMENT_ERROR error code- 参数:
message- error message
-
TokenManagementException
Constructor - uses default TOKEN_MANAGEMENT_ERROR error code with cause- 参数:
message- error messagecause- root cause exception
-
TokenManagementException
Constructor - specifies specific error code- 参数:
errorCode- specific token management error codemessage- error message
-
TokenManagementException
Constructor - specifies specific error code with cause- 参数:
errorCode- specific token management error codemessage- error messagecause- root cause exception
-
TokenManagementException
Constructor - includes context information- 参数:
errorCode- specific token management error codemessage- error messagecontext- context information
-
TokenManagementException
public TokenManagementException(ErrorCode errorCode, String message, Map<String, Object> context, Throwable cause) Constructor - full parameters- 参数:
errorCode- specific token management error codemessage- error messagecontext- context informationcause- root cause exception
-
-
方法详细资料
-
tokenFetchFailed
Create token fetch failed exception- 参数:
message- error messagecause- root cause exception- 返回:
- TokenManagementException instance
-
tokenParseError
Create token parse error exception- 参数:
message- error messageresponseBody- response body content for debugging- 返回:
- TokenManagementException instance
-
tokenCacheError
Create token cache operation failed exception- 参数:
message- error messagecause- root cause exception- 返回:
- TokenManagementException instance
-
tokenRefreshFailed
Create token refresh failed exception- 参数:
message- error messagecause- root cause exception- 返回:
- TokenManagementException instance
-
tokenFetchFailedWithApiInfo
public static TokenManagementException tokenFetchFailedWithApiInfo(String message, int apiCode, String apiMessage) Create token fetch failed exception with API response info- 参数:
message- error messageapiCode- API returned error codeapiMessage- API returned error message- 返回:
- TokenManagementException instance
-
withRetryInfo
public static TokenManagementException withRetryInfo(ErrorCode errorCode, String message, int retryCount, int maxRetries, Throwable cause) Create token management exception with retry information- 参数:
errorCode- error codemessage- error messageretryCount- retry countmaxRetries- maximum retry countcause- root cause exception- 返回:
- TokenManagementException instance
-
isNetworkRelated
public boolean isNetworkRelated()Check if this is a network-related token management exception- 返回:
- true if network-related exception
-
isApiResponseRelated
public boolean isApiResponseRelated()Check if this is an API response-related exception- 返回:
- true if API response-related exception
-
isCacheRelated
public boolean isCacheRelated()Check if this is a cache-related exception- 返回:
- true if cache-related exception
-
getSuggestedRetryDelay
public long getSuggestedRetryDelay(int retryCount) Get suggested retry delay time in milliseconds- 参数:
retryCount- current retry count- 返回:
- suggested delay time
-
getUserFriendlyMessage
Get user-friendly error message- 覆盖:
getUserFriendlyMessage在类中FsHelperException- 返回:
- user-friendly error message
-