aleph.types.message_status module

exception aleph.types.message_status.AmendTargetNotFound(errors: str | Sequence[Any] | None = None)[source]

Bases: RetryMessageException

The original post for an amend could not be found.

error_code: ErrorCode = 101
exception aleph.types.message_status.CannotAmendAmend(errors: str | Sequence[Any] | None = None)[source]

Bases: InvalidMessageException

The original post targeted by an amend is an amend itself, which is forbidden.

error_code: ErrorCode = 102
exception aleph.types.message_status.CannotForgetForgetMessage(target_hash: str)[source]

Bases: InvalidMessageException

The FORGET message targets another FORGET message, which is forbidden.

details() Dict[str, Any] | None[source]
error_code: ErrorCode = 502
class aleph.types.message_status.ErrorCode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

BALANCE_INSUFFICIENT = 5
CONTENT_UNAVAILABLE = 3
FILE_UNAVAILABLE = 4
FORGET_FORGET = 502
FORGET_NO_TARGET = 500
FORGET_TARGET_NOT_FOUND = 501
INTERNAL_ERROR = -1
INVALID_FORMAT = 0
INVALID_SIGNATURE = 1
PERMISSION_DENIED = 2
POST_AMEND_AMEND = 102
POST_AMEND_NO_TARGET = 100
POST_AMEND_TARGET_NOT_FOUND = 101
STORE_REF_NOT_FOUND = 200
STORE_UPDATE_UPDATE = 201
VM_AMEND_NOT_ALLOWED = 302
VM_REF_NOT_FOUND = 300
VM_UPDATE_UPDATE = 303
VM_VOLUME_NOT_FOUND = 301
VM_VOLUME_TOO_SMALL = 304
exception aleph.types.message_status.FileNotFoundException(file_hash: str)[source]

Bases: RetryMessageException

A file required to process the message could not be found, locally and/or on the network.

exception aleph.types.message_status.FileUnavailable(file_hash: str)[source]

Bases: FileNotFoundException

A file pointed to by the message is not available at the moment.

error_code: ErrorCode = 4
exception aleph.types.message_status.ForgetTargetNotFound(target_hash: str | None = None, aggregate_key: str | None = None)[source]

Bases: RetryMessageException

A target specified in the FORGET message could not be found.

details() Dict[str, Any] | None[source]
error_code: ErrorCode = 501
exception aleph.types.message_status.InsufficientBalanceException(balance: Decimal, required_balance: Decimal)[source]

Bases: InvalidMessageException

The user does not have enough Aleph tokens to process the message.

details() Dict[str, Any] | None[source]
error_code: ErrorCode = 5
exception aleph.types.message_status.InternalError(errors: str | Sequence[Any] | None = None)[source]

Bases: RetryMessageException

An unexpected situation occurred.

error_code: ErrorCode = -1
exception aleph.types.message_status.InvalidMessageException(errors: str | Sequence[Any] | None = None)[source]

Bases: MessageProcessingException

The message is invalid and should be rejected.

exception aleph.types.message_status.InvalidMessageFormat(errors: str | Sequence[Any] | None = None)[source]

Bases: InvalidMessageException

The message is invalid because it is not properly formatted: missing field(s), incorrect value types, etc.

error_code: ErrorCode = 0
exception aleph.types.message_status.InvalidSignature(errors: str | Sequence[Any] | None = None)[source]

Bases: InvalidMessageException

The message is invalid, in particular because its signature does not match the expected value.

error_code: ErrorCode = 1
exception aleph.types.message_status.MessageContentUnavailable(file_hash: str)[source]

Bases: FileNotFoundException

The message content is not available at the moment (storage/IPFS item types).

error_code: ErrorCode = 3
exception aleph.types.message_status.MessageProcessingException(errors: str | Sequence[Any] | None = None)[source]

Bases: Exception

details() Dict[str, Any] | None[source]
error_code: ErrorCode
class aleph.types.message_status.MessageProcessingStatus(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

FAILED_REJECTED = 'rejected'
FAILED_WILL_RETRY = 'retry'
PROCESSED_CONFIRMATION = 'confirmed'
PROCESSED_NEW_MESSAGE = 'processed'
to_message_status() MessageStatus[source]
class aleph.types.message_status.MessageStatus(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

FORGOTTEN = 'forgotten'
PENDING = 'pending'
PROCESSED = 'processed'
REJECTED = 'rejected'
exception aleph.types.message_status.NoAmendTarget(errors: str | Sequence[Any] | None = None)[source]

Bases: InvalidMessageException

A POST with type = amend does not specify a value in the ref field.

error_code: ErrorCode = 100
exception aleph.types.message_status.NoForgetTarget(errors: str | Sequence[Any] | None = None)[source]

Bases: InvalidMessageException

The FORGET message specifies nothing to forget.

error_code: ErrorCode = 500
exception aleph.types.message_status.PermissionDenied(errors: str | Sequence[Any] | None = None)[source]

Bases: InvalidMessageException

The sender does not have the permission to perform the requested operation on the specified object.

error_code: ErrorCode = 2
exception aleph.types.message_status.RetryMessageException(errors: str | Sequence[Any] | None = None)[source]

Bases: MessageProcessingException

The message should be retried.

exception aleph.types.message_status.StoreCannotUpdateStoreWithRef(errors: str | Sequence[Any] | None = None)[source]

Bases: InvalidMessageException

The store message targeted by the ref field has a value in the ref field itself. Update trees are not supported.

error_code: ErrorCode = 201
exception aleph.types.message_status.StoreRefNotFound(errors: str | Sequence[Any] | None = None)[source]

Bases: RetryMessageException

The original store message hash specified in the ref field could not be found.

error_code: ErrorCode = 200
exception aleph.types.message_status.VmCannotUpdateUpdate(errors: str | Sequence[Any] | None = None)[source]

Bases: InvalidMessageException

The program hash in the replaces field has a value for the replaces field itself. Update trees are not supported.

error_code: ErrorCode = 303
exception aleph.types.message_status.VmRefNotFound(errors: str | Sequence[Any] | None = None)[source]

Bases: RetryMessageException

The original program specified in the ref field could not be found.

error_code: ErrorCode = 300
exception aleph.types.message_status.VmUpdateNotAllowed(errors: str | Sequence[Any] | None = None)[source]

Bases: InvalidMessageException

The message attempts to amend an immutable program, i.e. for which allow_amend is set to False.

error_code: ErrorCode = 302
exception aleph.types.message_status.VmVolumeNotFound(errors: str | Sequence[Any] | None = None)[source]

Bases: RetryMessageException

One or more volume files could not be found.

error_code: ErrorCode = 301
exception aleph.types.message_status.VmVolumeTooSmall(volume_name: str, volume_size: int, parent_ref: str, parent_file: str, parent_size: int)[source]

Bases: InvalidMessageException

A volume with a parent volume has a size inferior to the size of the parent. Ex: attempting to use a 4GB Ubuntu rootfs to a 2GB volume.

details() Dict[str, Any] | None[source]
error_code: ErrorCode = 304