wasat.status
Gemini protocol status codes and categories.
StatusCode
Bases: IntEnum
Gemini protocol status codes.
category
property
category: int
Returns the primary status code category (1-6).
Returns:
| Type | Description |
|---|---|
int
|
The category as an integer (e.g. 2 for SUCCESS). |
is_client_certificate_required
property
is_client_certificate_required: bool
Check if the status indicates a client certificate issue.
Returns:
| Type | Description |
|---|---|
bool
|
True if the status is in the 6x range, False otherwise. |
is_failure
property
is_failure: bool
Check if the status indicates a failure (4x or 5x).
Returns:
| Type | Description |
|---|---|
bool
|
True if the status is in the 4x or 5x range, False otherwise. |
is_input
property
is_input: bool
Check if the status requires client input.
Returns:
| Type | Description |
|---|---|
bool
|
True if the status is in the 1x range, False otherwise. |
is_permanent_failure
property
is_permanent_failure: bool
Check if the status indicates a permanent failure.
Returns:
| Type | Description |
|---|---|
bool
|
True if the status is in the 5x range, False otherwise. |
is_redirect
property
is_redirect: bool
Check if the status indicates a redirect.
Returns:
| Type | Description |
|---|---|
bool
|
True if the status is in the 3x range, False otherwise. |
is_success
property
is_success: bool
Check if the status indicates success.
Returns:
| Type | Description |
|---|---|
bool
|
True if the status is 20, False otherwise. |
is_temporary_failure
property
is_temporary_failure: bool
Check if the status indicates a temporary failure.
Returns:
| Type | Description |
|---|---|
bool
|
True if the status is in the 4x range, False otherwise. |
from_int
classmethod
from_int(value: int) -> StatusCode
Resolve a status code integer, falling back to the group's primary code if unallocated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
The status code integer value. |
required |
Returns:
| Type | Description |
|---|---|
StatusCode
|
The resolved StatusCode. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the status code or its group is invalid. |