error_messages

package
v0.43.1-rc.1.access-me... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFailedErrorMessage = "failed"

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// ErrorMessageByTransactionID is a function type for getting transaction error message by block ID and transaction ID.
	// Expected errors during normal operation:
	//   - InsufficientExecutionReceipts - found insufficient receipts for given block ID.
	//   - status.Error - remote GRPC call to EN has failed.
	ErrorMessageByTransactionID(ctx context.Context, blockID flow.Identifier, height uint64, transactionID flow.Identifier) (string, error)

	// ErrorMessageByIndex is a function type for getting transaction error message by index.
	// Expected errors during normal operation:
	//   - InsufficientExecutionReceipts - found insufficient receipts for given block ID.
	//   - status.Error - remote GRPC call to EN has failed.
	ErrorMessageByIndex(ctx context.Context, blockID flow.Identifier, height uint64, index uint32) (string, error)

	// ErrorMessagesByBlockID is a function type for getting transaction error messages by block ID.
	// Expected errors during normal operation:
	//   - InsufficientExecutionReceipts - found insufficient receipts for given block ID.
	//   - status.Error - remote GRPC call to EN has failed.
	ErrorMessagesByBlockID(ctx context.Context, blockID flow.Identifier, height uint64) (map[flow.Identifier]string, error)

	// ErrorMessageFromAnyEN performs an RPC call using available nodes passed as argument.
	// List of nodes must be non-empty otherwise an error will be returned.
	// Expected errors during normal operation:
	//   - status.Error - GRPC call failed, some of possible codes are:
	//   - codes.NotFound - request cannot be served by EN because of absence of data.
	//   - codes.Unavailable - remote node is not unavailable.
	ErrorMessageFromAnyEN(
		ctx context.Context,
		execNodes flow.IdentitySkeletonList,
		req *execproto.GetTransactionErrorMessageRequest,
	) (*execproto.GetTransactionErrorMessageResponse, error)

	// ErrorMessageByIndexFromAnyEN performs an RPC call using available nodes passed as argument.
	// List of nodes must be non-empty otherwise an error will be returned.
	// Expected errors during normal operation:
	//   - status.Error - GRPC call failed, some of possible codes are:
	//   - codes.NotFound - request cannot be served by EN because of absence of data.
	//   - codes.Unavailable - remote node is not unavailable.
	ErrorMessageByIndexFromAnyEN(
		ctx context.Context,
		execNodes flow.IdentitySkeletonList,
		req *execproto.GetTransactionErrorMessageByIndexRequest,
	) (*execproto.GetTransactionErrorMessageResponse, error)

	// ErrorMessageByBlockIDFromAnyEN performs an RPC call using available nodes passed as argument.
	// List of nodes must be non-empty otherwise an error will be returned.
	// Expected errors during normal operation:
	//   - status.Error - GRPC call failed, some of possible codes are:
	//   - codes.NotFound - request cannot be served by EN because of absence of data.
	//   - codes.Unavailable - remote node is not unavailable.
	ErrorMessageByBlockIDFromAnyEN(
		ctx context.Context,
		execNodes flow.IdentitySkeletonList,
		req *execproto.GetTransactionErrorMessagesByBlockIDRequest,
	) ([]*execproto.GetTransactionErrorMessagesResponse_Result, *flow.IdentitySkeleton, error)
}

Provider declares the lookup transaction error methods by different input parameters.

type ProviderImpl

type ProviderImpl struct {
	// contains filtered or unexported fields
}

func NewTxErrorMessageProvider

func NewTxErrorMessageProvider(
	log zerolog.Logger,
	txResultErrorMessages storage.TransactionResultErrorMessages,
	txResultsIndex *index.TransactionResultsIndex,
	connFactory connection.ConnectionFactory,
	nodeCommunicator node_communicator.Communicator,
	execNodeIdentitiesProvider *rpc.ExecutionNodeIdentitiesProvider,
) *ProviderImpl

func (*ProviderImpl) ErrorMessageByBlockIDFromAnyEN

ErrorMessageByBlockIDFromAnyEN performs an RPC call using available nodes passed as argument. List of nodes must be non-empty otherwise an error will be returned. Expected errors during normal operation:

  • status.Error - GRPC call failed, some of possible codes are:
  • codes.NotFound - request cannot be served by EN because of absence of data.
  • codes.Unavailable - remote node is not unavailable.

func (*ProviderImpl) ErrorMessageByIndex

func (e *ProviderImpl) ErrorMessageByIndex(
	ctx context.Context,
	blockID flow.Identifier,
	height uint64,
	index uint32,
) (string, error)

ErrorMessageByIndex returns the transaction error message for a specified transaction using its index. If transaction error messages are stored locally, they will be checked first in local storage. If error messages are not stored locally, an RPC call will be made to the EN to fetch message.

Expected errors during normal operation:

  • InsufficientExecutionReceipts - found insufficient receipts for the given block ID.
  • status.Error - remote GRPC call to EN has failed.

func (*ProviderImpl) ErrorMessageByIndexFromAnyEN

ErrorMessageByIndexFromAnyEN performs an RPC call using available nodes passed as argument. List of nodes must be non-empty otherwise an error will be returned. Expected errors during normal operation:

  • status.Error - GRPC call failed, some of possible codes are:
  • codes.NotFound - request cannot be served by EN because of absence of data.
  • codes.Unavailable - remote node is not unavailable.

func (*ProviderImpl) ErrorMessageByTransactionID

func (e *ProviderImpl) ErrorMessageByTransactionID(
	ctx context.Context,
	blockID flow.Identifier,
	height uint64,
	transactionID flow.Identifier,
) (string, error)

ErrorMessageByTransactionID returns transaction error message for specified transaction. If transaction error messages are stored locally, they will be checked first in local storage. If error messages are not stored locally, an RPC call will be made to the EN to fetch message.

Expected errors during normal operation:

  • InsufficientExecutionReceipts - found insufficient receipts for the given block ID.
  • status.Error - remote GRPC call to EN has failed.

func (*ProviderImpl) ErrorMessageFromAnyEN

ErrorMessageFromAnyEN performs an RPC call using available nodes passed as argument. List of nodes must be non-empty otherwise an error will be returned. Expected errors during normal operation:

  • status.Error - GRPC call failed, some of possible codes are:
  • codes.NotFound - request cannot be served by EN because of absence of data.
  • codes.Unavailable - remote node is not unavailable.

func (*ProviderImpl) ErrorMessagesByBlockID

func (e *ProviderImpl) ErrorMessagesByBlockID(
	ctx context.Context,
	blockID flow.Identifier,
	height uint64,
) (map[flow.Identifier]string, error)

ErrorMessagesByBlockID returns all error messages for failed transactions by blockID. If transaction error messages are stored locally, they will be checked first in local storage. If error messages are not stored locally, an RPC call will be made to the EN to fetch messages.

Expected errors during normal operation:

  • InsufficientExecutionReceipts - found insufficient receipts for the given block ID.
  • status.Error - remote GRPC call to EN has failed.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL