Skip to content

Errors

Exception classes raised by the library.

GrocyError

Raised when the Grocy API returns an HTTP 4xx or 5xx response.

from pygrocy2.errors import GrocyError

try:
    product = grocy.product(99999)
except GrocyError as e:
    print(f"HTTP {e.status_code}: {e.message}")

GrocyError(response)

Bases: Exception

status_code property

message property

is_client_error property

is_server_error property