bittensor.core.errors#

Attributes#

Exceptions#

BalanceTypeError

Raised when a Balance object receives an invalid type.

BalanceUnitMismatchError

Raised when Balance objects with different units are used in operations.

BlacklistedException

This exception is raised when the request is blacklisted.

InternalServerError

This exception is raised when the requested function fails on the server. Indicates a server error.

InvalidRequestNameError

This exception is raised when the request name is invalid. Usually indicates a broken URL.

MaxAttemptsException

Raised when the POW Solver has reached the max number of attempts.

MaxSuccessException

Raised when the POW Solver has reached the max number of successful solutions.

NotVerifiedException

This exception is raised when the request is not verified.

PostProcessException

This exception is raised when the response headers cannot be updated.

PriorityException

This exception is raised when the request priority is not met.

RunException

This exception is raised when the requested function cannot be executed. Indicates a server error.

SynapseDendriteNoneException

Common base class for all non-exit exceptions.

SynapseException

Common base class for all non-exit exceptions.

SynapseParsingError

This exception is raised when the request headers are unable to be parsed into the synapse type.

UnknownSynapseError

This exception is raised when the request name is not found in the Axon's forward_fns dictionary.

Classes#

ChainConnectionError

Error for any chain connection related errors.

ChainError

Base error for any chain related errors.

ChainQueryError

Error for any chain query related errors.

ChainTransactionError

Error for any chain transaction related errors.

DelegateTakeTooHigh

Delegate take is too high.

DelegateTakeTooLow

Delegate take is too low.

DelegateTxRateLimitExceeded

A transactor exceeded the rate limit for delegate transaction.

DuplicateChild

Duplicate child when setting children.

HotKeyAccountNotExists

The hotkey does not exist.

IdentityError

Error raised when an identity transaction fails.

InvalidChild

Attempting to set an invalid child for a hotkey on a network.

MetadataError

Error raised when metadata commitment transaction fails.

NominationError

Error raised when a nomination transaction fails.

NonAssociatedColdKey

Request to stake, unstake or subscribe is made by a coldkey that is not associated with the hotkey account.

NotDelegateError

Error raised when a hotkey you are trying to stake to is not a delegate.

NotEnoughStakeToSetChildkeys

The parent hotkey doesn't have enough own stake to set childkeys.

NotRegisteredError

Error raised when a neuron is not registered, and the transaction requires it to be.

ProportionOverflow

Proportion overflow when setting children.

RegistrationError

Error raised when a neuron registration transaction fails.

RegistrationNotPermittedOnRootSubnet

Operation is not permitted on the root subnet.

StakeError

Error raised when a stake transaction fails.

SubnetNotExists

The subnet does not exist.

TakeError

Error raised when an increase / decrease take transaction fails.

TooManyChildren

Too many children MAX 5.

TransferError

Error raised when a transfer transaction fails.

TxRateLimitExceeded

Default transaction rate limit exceeded.

UnstakeError

Error raised when an unstake transaction fails.

Functions#

map_shield_error(raw_message)

Map a raw shield validation error to a human-readable description.

Module Contents#

exception bittensor.core.errors.BalanceTypeError#

Bases: Exception

Raised when a Balance object receives an invalid type.

Initialize self. See help(type(self)) for accurate signature.

exception bittensor.core.errors.BalanceUnitMismatchError#

Bases: Exception

Raised when Balance objects with different units are used in operations.

Initialize self. See help(type(self)) for accurate signature.

exception bittensor.core.errors.BlacklistedException(message='Synapse Exception', synapse=None)#

Bases: SynapseException

This exception is raised when the request is blacklisted.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

synapse (Optional[bittensor.core.synapse.Synapse])

class bittensor.core.errors.ChainConnectionError#

Bases: ChainError

Error for any chain connection related errors.

class bittensor.core.errors.ChainError#

Bases: async_substrate_interface.errors.SubstrateRequestException

Base error for any chain related errors.

classmethod from_error(error)#
class bittensor.core.errors.ChainQueryError#

Bases: ChainError

Error for any chain query related errors.

class bittensor.core.errors.ChainTransactionError#

Bases: ChainError

Error for any chain transaction related errors.

class bittensor.core.errors.DelegateTakeTooHigh#

Bases: ChainTransactionError

Delegate take is too high.

class bittensor.core.errors.DelegateTakeTooLow#

Bases: ChainTransactionError

Delegate take is too low.

class bittensor.core.errors.DelegateTxRateLimitExceeded#

Bases: TxRateLimitExceeded

A transactor exceeded the rate limit for delegate transaction.

class bittensor.core.errors.DuplicateChild#

Bases: ChainTransactionError

Duplicate child when setting children.

class bittensor.core.errors.HotKeyAccountNotExists#

Bases: ChainTransactionError

The hotkey does not exist.

class bittensor.core.errors.IdentityError#

Bases: ChainTransactionError

Error raised when an identity transaction fails.

exception bittensor.core.errors.InternalServerError(message='Synapse Exception', synapse=None)#

Bases: SynapseException

This exception is raised when the requested function fails on the server. Indicates a server error.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

synapse (Optional[bittensor.core.synapse.Synapse])

class bittensor.core.errors.InvalidChild#

Bases: ChainTransactionError

Attempting to set an invalid child for a hotkey on a network.

exception bittensor.core.errors.InvalidRequestNameError#

Bases: Exception

This exception is raised when the request name is invalid. Usually indicates a broken URL.

Initialize self. See help(type(self)) for accurate signature.

exception bittensor.core.errors.MaxAttemptsException#

Bases: Exception

Raised when the POW Solver has reached the max number of attempts.

Initialize self. See help(type(self)) for accurate signature.

exception bittensor.core.errors.MaxSuccessException#

Bases: Exception

Raised when the POW Solver has reached the max number of successful solutions.

Initialize self. See help(type(self)) for accurate signature.

class bittensor.core.errors.MetadataError#

Bases: ChainTransactionError

Error raised when metadata commitment transaction fails.

class bittensor.core.errors.NominationError#

Bases: ChainTransactionError

Error raised when a nomination transaction fails.

class bittensor.core.errors.NonAssociatedColdKey#

Bases: ChainTransactionError

Request to stake, unstake or subscribe is made by a coldkey that is not associated with the hotkey account.

class bittensor.core.errors.NotDelegateError#

Bases: StakeError

Error raised when a hotkey you are trying to stake to is not a delegate.

class bittensor.core.errors.NotEnoughStakeToSetChildkeys#

Bases: ChainTransactionError

The parent hotkey doesn’t have enough own stake to set childkeys.

class bittensor.core.errors.NotRegisteredError#

Bases: ChainTransactionError

Error raised when a neuron is not registered, and the transaction requires it to be.

exception bittensor.core.errors.NotVerifiedException(message='Synapse Exception', synapse=None)#

Bases: SynapseException

This exception is raised when the request is not verified.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

synapse (Optional[bittensor.core.synapse.Synapse])

exception bittensor.core.errors.PostProcessException(message='Synapse Exception', synapse=None)#

Bases: SynapseException

This exception is raised when the response headers cannot be updated.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

synapse (Optional[bittensor.core.synapse.Synapse])

exception bittensor.core.errors.PriorityException(message='Synapse Exception', synapse=None)#

Bases: SynapseException

This exception is raised when the request priority is not met.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

synapse (Optional[bittensor.core.synapse.Synapse])

class bittensor.core.errors.ProportionOverflow#

Bases: ChainTransactionError

Proportion overflow when setting children.

class bittensor.core.errors.RegistrationError#

Bases: ChainTransactionError

Error raised when a neuron registration transaction fails.

class bittensor.core.errors.RegistrationNotPermittedOnRootSubnet#

Bases: ChainTransactionError

Operation is not permitted on the root subnet.

exception bittensor.core.errors.RunException(message='Synapse Exception', synapse=None)#

Bases: SynapseException

This exception is raised when the requested function cannot be executed. Indicates a server error.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

synapse (Optional[bittensor.core.synapse.Synapse])

bittensor.core.errors.SHIELD_VALIDATION_ERRORS#
class bittensor.core.errors.StakeError#

Bases: ChainTransactionError

Error raised when a stake transaction fails.

class bittensor.core.errors.SubnetNotExists#

Bases: ChainTransactionError

The subnet does not exist.

exception bittensor.core.errors.SynapseDendriteNoneException(message='Synapse Dendrite is None', synapse=None)#

Bases: SynapseException

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

synapse (Optional[bittensor.core.synapse.Synapse])

message = 'Synapse Dendrite is None'#
exception bittensor.core.errors.SynapseException(message='Synapse Exception', synapse=None)#

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

synapse (Optional[bittensor.core.synapse.Synapse])

message = 'Synapse Exception'#
synapse = None#
exception bittensor.core.errors.SynapseParsingError#

Bases: Exception

This exception is raised when the request headers are unable to be parsed into the synapse type.

Initialize self. See help(type(self)) for accurate signature.

class bittensor.core.errors.TakeError#

Bases: ChainTransactionError

Error raised when an increase / decrease take transaction fails.

class bittensor.core.errors.TooManyChildren#

Bases: ChainTransactionError

Too many children MAX 5.

class bittensor.core.errors.TransferError#

Bases: ChainTransactionError

Error raised when a transfer transaction fails.

class bittensor.core.errors.TxRateLimitExceeded#

Bases: ChainTransactionError

Default transaction rate limit exceeded.

exception bittensor.core.errors.UnknownSynapseError(message='Synapse Exception', synapse=None)#

Bases: SynapseException

This exception is raised when the request name is not found in the Axon’s forward_fns dictionary.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

synapse (Optional[bittensor.core.synapse.Synapse])

class bittensor.core.errors.UnstakeError#

Bases: ChainTransactionError

Error raised when an unstake transaction fails.

bittensor.core.errors.map_shield_error(raw_message)#

Map a raw shield validation error to a human-readable description.

Checks the message against known Custom error codes from CheckShieldedTxValidity, then falls back to detecting a generic "invalid" subscription status. Returns the original message unchanged if nothing matches.

Parameters:

raw_message (str)

Return type:

str