Exception Reference

This section lists all custom exceptions raised by the sonyflake library.

Base Exception

class sonyflake.SonyflakeError[source]

Base class for all sonyflake errors.

Configuration Exceptions

class sonyflake.InvalidBitsSequence[source]

Raised when the bit length for the sequence is out of valid range (0-30).

class sonyflake.InvalidBitsMachineID[source]

Raised when the bit length for the machine ID is out of valid range (0-30).

class sonyflake.InvalidBitsTime[source]

Raised when the computed time bit length is too small to represent valid timestamps.

class sonyflake.InvalidTimeUnit[source]

Raised when the provided time unit is too small.

class sonyflake.InvalidSequence(bits_sequence: int)[source]

Raised when the sequence number is out of valid range.

class sonyflake.InvalidMachineID(bits_machine_id: int)[source]

Raised when the computed machine ID is out of range.

class sonyflake.MachineIDCheckFailure(machine_id: int)[source]

Raised when a machine ID fails the validation check.

Added in version 2.0.

class sonyflake.StartTimeAhead[source]

Raised when the provided start time is ahead of the current time.

Runtime Exceptions

class sonyflake.OverTimeLimit(max_elapsed_time: int)[source]

Raised when the elapsed time exceeds the representable limit.

class sonyflake.NoPrivateAddress[source]

Raised when no private IPv4 address could be determined.