Skip to content

Commit c9753f5

Browse files
committed
zephyr: errno: handle unknown values
Handle unknown errno values when converting to a string, instead of raising an exception. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent f04930a commit c9753f5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/infuse_iot/zephyr/errno.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,7 @@ def __new__(cls, value: int, description: str = ""):
104104

105105
@classmethod
106106
def strerror(cls, int) -> str:
107-
return cls(int).description
107+
try:
108+
return cls(int).description
109+
except ValueError:
110+
return f"Unknown errno ({int})"

0 commit comments

Comments
 (0)