File tree 3 files changed +19
-4
lines changed
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
11
11
12
12
<!-- towncrier release notes start -->
13
13
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
+
14
20
## [ 1.10.0] ( https://github.com/opsmill/infrahub-sdk-python/tree/v1.10.0 ) - 2025-04-01
15
21
16
22
### Deprecated
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
3
import asyncio
4
+ import json
4
5
from collections .abc import MutableMapping
5
6
from enum import Enum
6
7
from time import sleep
13
14
14
15
from ..exceptions import (
15
16
InvalidResponseError ,
17
+ JsonDecodeError ,
16
18
SchemaNotFoundError ,
17
19
ValidationError ,
18
20
)
@@ -420,7 +422,14 @@ async def _fetch(
420
422
response = await self .client ._get (url = url , timeout = timeout )
421
423
response .raise_for_status ()
422
424
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
424
433
425
434
nodes : MutableMapping [str , MainSchemaTypesAPI ] = {}
426
435
for node_schema in data .get ("nodes" , []):
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " infrahub-sdk"
3
- version = " 1.10.0 "
3
+ version = " 1.10.1 "
4
4
description = " Python Client to interact with Infrahub"
5
5
authors = [
" OpsMill <[email protected] >" ]
6
6
readme = " README.md"
7
7
license = " Apache-2.0"
8
8
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 "
11
11
packages = [{ include = " infrahub_sdk" }]
12
12
classifiers = [
13
13
" Intended Audience :: Developers" ,
You can’t perform that action at this time.
0 commit comments