Skip to content

Commit

Permalink
error: allow user and external group ids
Browse files Browse the repository at this point in the history
The V2 Error group field only accepted header.GroupId, which would lead to validation errors when smpclient received v2 error responses from SMP groups beyond the standard set. This change allows creating ErrorV2 instances for both User Groups defined in the tree (i.e. Intercreate) as well as for User Groups defined outside of the tree.
  • Loading branch information
sam-golioth committed Feb 10, 2025
1 parent b32db57 commit 55154bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions smp/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from __future__ import annotations

from enum import IntEnum, unique
from typing import Generic, TypeVar
from typing import Generic, TypeVar, Union

from pydantic import BaseModel, ConfigDict

from smp import message
from smp.header import GroupId
from smp.header import AnyGroupId, GroupId, UserGroupId

T = TypeVar("T", bound=IntEnum)

Expand Down Expand Up @@ -80,7 +80,7 @@ class Err(BaseModel, Generic[T]):

model_config = ConfigDict(extra="forbid", frozen=True, arbitrary_types_allowed=True)

group: GroupId
group: Union[GroupId | UserGroupId | AnyGroupId]
rc: T


Expand Down

0 comments on commit 55154bf

Please sign in to comment.