Skip to content

Commit

Permalink
allow ExcInfo.extra to be None
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorcary committed Aug 16, 2024
1 parent ad6cb08 commit e49c110
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions truenas_api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def result(self) -> Any:
raise ClientException('No job event was received.')
if job['state'] != 'SUCCESS':
if job['exc_info'] and job['exc_info']['type'] == 'VALIDATION':
raise ValidationErrors(job['exc_info']['extra'])
raise ValidationErrors(job['exc_info']['extra'] or [])
raise ClientException(
job['error'],
trace={
Expand Down Expand Up @@ -674,7 +674,7 @@ def on_close(self, code: int, reason: str | None=None):
job['exc_info'] = {
'type': 'Exception',
'repr': error,
'extra': [],
'extra': None,
}
event.set()

Expand Down
2 changes: 1 addition & 1 deletion truenas_api_client/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ErrorExtra(NamedTuple):

class ExcInfo(TypedDict):
type: str
extra: list[ErrorExtra]
extra: list[ErrorExtra] | None
repr: str


Expand Down

0 comments on commit e49c110

Please sign in to comment.