Skip to main content

Exceptions and Error Handling

As you engage with our Python SDK, you'll encounter various exceptional situations that demand specific attention and resolution. To facilitate your debugging process and enable effective error handling, we've designed a set of custom exceptions, each meticulously crafted to address distinct error scenarios you might face when utilizing the SDK.

In this section, you'll find a comprehensive catalog of custom exceptions that may show while working with our Python SDK. Each exception is accompanied by a concise explanation to guide you in identifying and mitigating these errors.

Explore the list below to gain a thorough understanding of each custom exception and its role in facilitating debugging and issue resolution within your Python SDK-powered projects.

InvalidSeedException

This exception is raised when an invalid seed is encountered. It should be employed when detecting seed-related issues in your code.

InvalidWordCountException

Raise this exception when you encounter problems with word counts in the seed or mnemonic, allowing you to handle word count errors in your application effectively.

InvalidLanguageException

In situations where your code uses an unsupported or invalid language, this exception provides the means to address language-related errors.

InvalidWordListException

This exception is instrumental in managing errors related to word lists for specific languages, signaling issues that may arise in your application.

MissingAPIkey

Raise this exception when an API key is missing or absent, assisting you in handling scenarios where the absence of an API key is detected.

ConnectionFailed

When your application faces difficulties connecting to the server, this exception allows you to gracefully manage connection errors.

Timeout

Handle timeouts effectively by raising this exception when a request to the server exceeds its allotted time.

ULRequestFailedException

This exception is a valuable resource for addressing request failures when your code encounters difficulties while sending requests to the server.

ResponseDecodeFailed

Use this exception when there are problems with decoding the response from the server, allowing you to address errors related to response decoding.

BlockchainCreationFailed

Raise this exception when you encounter issues in creating a blockchain within your application. It provides a tool to handle blockchain creation errors.

InvalidBlockchainData

Handle issues related to the provision of invalid data for blockchain creation by using this exception, which aids in validating data effectively.

UnsupportedHTTPMethod

In scenarios where unsupported HTTP methods are used, this exception assists in managing errors related to HTTP method choices.

BlocksRetrievalFailed

This exception proves invaluable in addressing situations where retrieving blocks from the server encounters difficulties.

InvalidParameters

Raise this exception when invalid parameters are provided for block retrieval, facilitating the effective handling of parameter validation errors.

BlockchainBlocksRetrievalFailedException

When difficulties arise in retrieving blocks from the blockchain, this exception provides a mechanism for handling blockchain block retrieval errors.

InvalidSearchTypeException

In scenarios where an invalid search type is used in your code, this exception is a powerful tool for effectively handling errors related to search type validation.

AtomicTimestampRetrievalFailed

Use this exception when difficulties occur in retrieving the atomic timestamp from the server. It not only handles the error but also includes the HTTP status code for reference.

InvalidPrivateKeyHexException

In cases where an invalid private key in hexadecimal format is provided, this exception serves as a means to handle errors related to private key format.

PrivateKeyGenerationFailedException

When your application encounters issues in generating a private key, this exception facilitates the effective handling of private key generation errors.

MissingPrivateKeyHexException

This exception is a valuable resource for managing errors related to the absence of private key hex information within a dictionary.

MessageSigningError

Handle errors in signing messages by raising this exception when your code encounters difficulties in the signing process.

SignatureVerificationError

Use this exception to effectively address errors related to the verification of signatures within your application.

SerializationError

In situations where your application encounters problems with serializing wallet data, this exception provides a tool for handling serialization errors.

DecryptionException

Effectively manage decryption failures by raising this exception, which is valuable for addressing errors, potentially related to invalid passwords.

EncryptionException

When encryption within your application fails, this exception serves as a means to effectively handle encryption errors.

ParsingError

Address issues related to parsing wallet data with this exception, which assists in handling errors arising from malformed data structures within your code.

© 2023 ULedger Inc. All rights reserved