Skip to content

Errors

errors

Errors received from the API.

Classes:

Functions:

Attributes:

ERRORS module-attribute

ERRORS: dict[int, tuple[_TGE, Optional[str]]] = {
    retcode: (
        (GenshinException, exc)
        if isinstance(exc, str)
        else exc
        if isinstance(exc, tuple)
        else (exc, None)
    )
    for (retcode, exc) in (items())
}

AccountDoesNotExist

AccountDoesNotExist(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Account does not exist.

Attributes:

msg class-attribute instance-attribute

msg = 'Account does not exist.'

retcode class-attribute instance-attribute

retcode = -3203

AccountHasLocked

AccountHasLocked(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Account has logged incorrect over than 3 - 5 time(s). It's will be locked and wait 20 minute.

Attributes:

msg class-attribute instance-attribute

msg = "Account has been locked because exceeded password limit. Please wait 20 minute and try again"

AccountLoginFail

AccountLoginFail(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Account if not exists in hoyoverse (Or password incorrect).

Attributes:

msg class-attribute instance-attribute

msg = 'Account login failed.'

AccountMuted

AccountMuted(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Account is muted.

Attributes:

msg class-attribute instance-attribute

msg = 'Account is muted.'

retcode class-attribute instance-attribute

retcode = 2010

AccountNotFound

AccountNotFound(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Tried to get data with an invalid uid.

Attributes:

msg class-attribute instance-attribute

msg = 'Could not find user; uid may be invalid.'

ActionInCooldown

ActionInCooldown(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Action is in cooldown.

AlreadyClaimed

AlreadyClaimed(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Already claimed the daily reward today.

Attributes:

msg class-attribute instance-attribute

msg = 'Already claimed the daily reward today.'

retcode class-attribute instance-attribute

retcode = -5003

AuthkeyException

AuthkeyException(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Base error for authkeys.

AuthkeyTimeout

AuthkeyTimeout(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Authkey has timed out.

Attributes:

msg class-attribute instance-attribute

msg = 'Authkey has timed out.'

retcode class-attribute instance-attribute

retcode = -101

CookieException

CookieException(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Base error for cookies.

DailyGeetestTriggered

DailyGeetestTriggered(
    response: Mapping[str, Any], *, gt: str, challenge: str
)

Geetest triggered during daily reward claim.

Attributes:

challenge instance-attribute

challenge: str = challenge

gt instance-attribute

gt: str = gt

msg class-attribute instance-attribute

msg = 'Geetest triggered during daily reward claim.'

DataNotPublic

DataNotPublic(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

User hasn't set their data to public.

Attributes:

msg class-attribute instance-attribute

msg = "User's data is not public."

GeetestError

GeetestError(response: dict[str, Any])

Geetest triggered during the battle chronicle API request.

Attributes:

msg class-attribute instance-attribute

msg = "Geetest triggered during the battle chronicle API request."

GeetestFailed

GeetestFailed(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Geetest verification failed.

Attributes:

msg class-attribute instance-attribute

msg = 'The provided aigis payload is invalid.'

GenshinException

GenshinException(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

A base genshin exception.

Attributes:

msg class-attribute instance-attribute

msg: str = msg or msg or original

original class-attribute instance-attribute

original: str = get('message', '')

response property

response: Mapping[str, Any]

retcode class-attribute instance-attribute

retcode: int = get('retcode', retcode)

IncorrectGameAccount

IncorrectGameAccount(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Game account is incorrect.

Attributes:

msg class-attribute instance-attribute

msg = 'Game account is incorrect.'

retcode class-attribute instance-attribute

retcode = -216

IncorrectGamePassword

IncorrectGamePassword(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Game password is incorrect.

Attributes:

msg class-attribute instance-attribute

msg = 'Game password is incorrect.'

retcode class-attribute instance-attribute

retcode = -202

InternalDatabaseError

InternalDatabaseError(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Internal database error.

Attributes:

retcode class-attribute instance-attribute

retcode = -1

InvalidAuthkey

InvalidAuthkey(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Authkey is not valid.

Attributes:

msg class-attribute instance-attribute

msg = 'Authkey is not valid.'

retcode class-attribute instance-attribute

retcode = -100

InvalidCookies

InvalidCookies(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Cookies weren't valid.

Attributes:

msg class-attribute instance-attribute

msg = 'Cookies are not valid.'

retcode class-attribute instance-attribute

retcode = -100

NoNeedGeetest

NoNeedGeetest(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

No need to do geetest.

OTPRateLimited

OTPRateLimited(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Too many OTP messages sent for the number.

The limit is 40 messages/day/number.

Attributes:

msg class-attribute instance-attribute

msg = 'Too many OTP messages sent for the number.'

retcode class-attribute instance-attribute

retcode = -119

RedeemGameLevelTooLow

RedeemGameLevelTooLow(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Redemption code cannot be claimed because the game level is too low.

RedemptionClaimed

RedemptionClaimed(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Redemption code has been claimed already.

Attributes:

msg class-attribute instance-attribute

msg = 'Redemption code has been claimed already.'

RedemptionCooldown

RedemptionCooldown(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Redemption is on cooldown.

Attributes:

msg class-attribute instance-attribute

msg = 'Redemption is on cooldown.'

RedemptionException

RedemptionException(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Exception caused by redeeming a code.

RedemptionInvalid

RedemptionInvalid(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Invalid redemption code.

Attributes:

msg class-attribute instance-attribute

msg = 'Invalid redemption code.'

RedemptionRegionLock

RedemptionRegionLock(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Redemption code is not available in the account's region.

Attributes:

msg class-attribute instance-attribute

msg = "Redemption code is not available in the account's region."

TooManyRequests

TooManyRequests(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Made too many requests and got ratelimited.

Attributes:

msg class-attribute instance-attribute

msg = "Cannot get data for more than 30 accounts per cookie per day."

retcode class-attribute instance-attribute

retcode = 10101

UserNotesAccessDenied

UserNotesAccessDenied(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Cannot view real-time notes of other users.

Attributes:

msg class-attribute instance-attribute

msg = 'Cannot view real-time notes of other users.'

retcode class-attribute instance-attribute

retcode = 10104

VerificationCodeRateLimited

VerificationCodeRateLimited(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Too many verification code requests for the account.

Attributes:

msg class-attribute instance-attribute

msg = "Too many verification code requests for the account."

retcode class-attribute instance-attribute

retcode = -3206

VisitsTooFrequently

VisitsTooFrequently(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Visited a page too frequently.

Must be handled with exponential backoff.

Attributes:

msg class-attribute instance-attribute

msg = 'Visits too frequently.'

retcode class-attribute instance-attribute

retcode = -110

WrongOTP

WrongOTP(
    response: Optional[Mapping[str, Any]] = None,
    msg: Optional[str] = None,
)

Wrong OTP code.

Attributes:

msg class-attribute instance-attribute

msg = 'The provided OTP code is wrong.'

check_for_geetest

check_for_geetest(data: dict[str, Any]) -> None

Check if geetest was triggered during the request and raise an error if so.

raise_for_retcode

raise_for_retcode(data: dict[str, Any]) -> NoReturn

Raise an equivalent error to a response.

game record

10001 = invalid cookie 101xx = generic errors

authkey: -100 = invalid authkey -101 = authkey timed out code redemption: 20xx = invalid code or state -107x = invalid cookies daily reward: -500x = already claimed the daily reward