Skip to content

Commit 30a5c24

Browse files
authored
Merge pull request #345 from opsmill/stable
Merge stable into develop
2 parents f3334a6 + d22626a commit 30a5c24

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang
1111

1212
<!-- towncrier release notes start -->
1313

14+
## [1.9.1](https://github.com/opsmill/infrahub-sdk-python/tree/v1.9.1) - 2025-04-04
15+
16+
### Changed
17+
18+
- Improve error message when a schema received from the server is not JSON valid. The new exception will be of type `infrahub_sdk.exceptions.JsonDecodeError` instead of `json.decoder.JSONDecodeError`
19+
1420
## [1.10.0](https://github.com/opsmill/infrahub-sdk-python/tree/v1.10.0) - 2025-04-01
1521

1622
### Deprecated

Diff for: infrahub_sdk/schema/__init__.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import asyncio
4+
import json
45
from collections.abc import MutableMapping
56
from enum import Enum
67
from time import sleep
@@ -13,6 +14,7 @@
1314

1415
from ..exceptions import (
1516
InvalidResponseError,
17+
JsonDecodeError,
1618
SchemaNotFoundError,
1719
ValidationError,
1820
)
@@ -420,7 +422,14 @@ async def _fetch(
420422
response = await self.client._get(url=url, timeout=timeout)
421423
response.raise_for_status()
422424

423-
data: MutableMapping[str, Any] = response.json()
425+
try:
426+
data: MutableMapping[str, Any] = response.json()
427+
except json.decoder.JSONDecodeError as exc:
428+
raise JsonDecodeError(
429+
message=f"Invalid Schema response received from the server at {response.url}: {response.text} [{response.status_code}] ",
430+
content=response.text,
431+
url=response.url,
432+
) from exc
424433

425434
nodes: MutableMapping[str, MainSchemaTypesAPI] = {}
426435
for node_schema in data.get("nodes", []):

Diff for: pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[tool.poetry]
22
name = "infrahub-sdk"
3-
version = "1.10.0"
3+
version = "1.10.1"
44
description = "Python Client to interact with Infrahub"
55
authors = ["OpsMill <[email protected]>"]
66
readme = "README.md"
77
license = "Apache-2.0"
88
homepage = "https://opsmill.com"
9-
repository = "https://github.com/opsmill/infrahub"
10-
documentation = "https://docs.infrahub.app/python-sdk/"
9+
repository = "https://github.com/opsmill/infrahub-sdk-python"
10+
documentation = "https://docs.infrahub.app/python-sdk/introduction"
1111
packages = [{ include = "infrahub_sdk" }]
1212
classifiers = [
1313
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)