Enum Class AltsFailure.Kind
- All Implemented Interfaces:
Serializable, Comparable<AltsFailure.Kind>, Constable
- Enclosing class:
AltsFailure
What kind of failure happened. One enum for the whole library, so a host writes its
switch
once; it ends in UNKNOWN so a default branch covers a constant a later release adds.
Three of them must never be confused, because their remedies are opposite: a refusal
(UNAUTHORIZED, REAUTH_REQUIRED) says the credential is the problem; an
unreachable service (NETWORK) says retry; a throttle (RATE_LIMITED) says wait.
Sending the user through a browser sign-in to fix an outage, or retrying into a rate limit, is
what conflating them costs.
- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe operation was stopped on the caller's side rather than failing: the host cancelled it, the runtime was closed, or the executor it was to run on refused it.The request conflicts with the current state: a service answered409, or a store file is held by another runtime, in this process or another.A cryptographic operation failed: a key did not unwrap, a ciphertext did not authenticate.The user refused an interactive sign-in: declined the consent page or the device code.What the caller supplied could not be used, and nothing was sent: an unreadable credential text, a skin that is not a skin, an argument out of range.The service could not be reached, the connection failed or timed out, or it answered with a server error (5xx,408).The host's configuration is missing or was refused: Microsoft sign-in without aMicrosoftAuthConfig, or a login service that does not support device-code sign-in, or a token endpoint answeringinvalid_clientorunauthorized_clientto the host's client registration, or Minecraft services refusing that registration's Xbox login with a403.The credential authenticated, but the account has no Minecraft profile or does not own the game.The thing asked for does not exist (404): no such resource.A service answered with something that is not what its protocol promises: a body that is not JSON, a field missing or of the wrong type.The service answered that the caller is sending too many requests (429).The credential is permanently spent (the token endpoint statedinvalid_grant) and a fresh interactive sign-in is the only remedy.A store file could not be read or written.An interactive sign-in was not finished in time: the device code expired, or the browser sign-in was never completed.The credential was refused, or is empty or malformed: a token the service answered401or403to, a cookie that produced no sign-in.A failure the library could not classify.The sign-in succeeded but Xbox Live refused to authorize the account;AltsFailure.xstsError()says why, and each cause is fixed by the user at a specific place rather than by retrying. -
Method Summary
Modifier and TypeMethodDescriptionstatic AltsFailure.KindReturns the enum constant of this class with the specified name.static AltsFailure.Kind[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NETWORK
The service could not be reached, the connection failed or timed out, or it answered with a server error (5xx,408). Nothing was spent; retrying is the remedy.- Since:
- 1.0.0
-
RATE_LIMITED
The service answered that the caller is sending too many requests (429). Nothing was spent; the remedy is to wait, forAltsFailure.retryAfter()when the service said how long, or to send from a different address.- Since:
- 1.0.0
-
UNAUTHORIZED
The credential was refused, or is empty or malformed: a token the service answered401or403to, a cookie that produced no sign-in. A stored refresh token, if there is one, may still renew the account.- Since:
- 1.0.0
-
REAUTH_REQUIRED
The credential is permanently spent (the token endpoint statedinvalid_grant) and a fresh interactive sign-in is the only remedy. Where the library held it for a stored account, the refresh token has been discarded.- Since:
- 1.0.0
-
NOT_ENTITLED
The credential authenticated, but the account has no Minecraft profile or does not own the game. Neither retrying nor signing in again changes it. Sign-in, check andProfileService.fetchall report a missing profile this way.- Since:
- 1.0.0
-
NOT_FOUND
The thing asked for does not exist (404): no such resource. A missing Minecraft profile isNOT_ENTITLEDinstead, and a lookup of a name nobody holds is an empty answer.- Since:
- 1.0.0
-
XBOX_DENIED
The sign-in succeeded but Xbox Live refused to authorize the account;AltsFailure.xstsError()says why, and each cause is fixed by the user at a specific place rather than by retrying.- Since:
- 1.0.0
-
DECLINED
The user refused an interactive sign-in: declined the consent page or the device code.- Since:
- 1.0.0
-
TIMED_OUT
An interactive sign-in was not finished in time: the device code expired, or the browser sign-in was never completed. Starting again issues a fresh challenge.- Since:
- 1.0.0
-
CANCELLED
The operation was stopped on the caller's side rather than failing: the host cancelled it, the runtime was closed, or the executor it was to run on refused it. Retrying on the same runtime does not help once it is closed.- Since:
- 1.0.0
-
INVALID_INPUT
What the caller supplied could not be used, and nothing was sent: an unreadable credential text, a skin that is not a skin, an argument out of range.- Since:
- 1.0.0
-
CONFLICT
The request conflicts with the current state: a service answered409, or a store file is held by another runtime, in this process or another.- Since:
- 1.0.0
-
NOT_CONFIGURED
The host's configuration is missing or was refused: Microsoft sign-in without aMicrosoftAuthConfig, or a login service that does not support device-code sign-in, or a token endpoint answeringinvalid_clientorunauthorized_clientto the host's client registration, or Minecraft services refusing that registration's Xbox login with a403. Neither a retry nor a fresh sign-in fixes it.- Since:
- 1.0.0
-
STORAGE
A store file could not be read or written.- Since:
- 1.0.0
-
CRYPTO
A cryptographic operation failed: a key did not unwrap, a ciphertext did not authenticate.- Since:
- 1.0.0
-
PROTOCOL
A service answered with something that is not what its protocol promises: a body that is not JSON, a field missing or of the wrong type.- Since:
- 1.0.0
-
UNKNOWN
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-