File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import asyncio
4+ import json
45from collections .abc import MutableMapping
56from enum import Enum
67from time import sleep
1314
1415from ..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" , []):
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " infrahub-sdk"
3- version = " 1.10.0 "
3+ version = " 1.10.1 "
44description = " Python Client to interact with Infrahub"
55authors = [
" OpsMill <[email protected] >" ]
66readme = " README.md"
77license = " Apache-2.0"
88homepage = " 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 "
1111packages = [{ include = " infrahub_sdk" }]
1212classifiers = [
1313 " Intended Audience :: Developers" ,
You can’t perform that action at this time.
0 commit comments