Skip to content

Commit 6a53454

Browse files
committed
Improve exception-handling as suggested
1 parent b386215 commit 6a53454

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

plugwise_usb/connection/manager.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,7 @@ async def setup_connection_to_stick(self, serial_path: str) -> None:
134134
),
135135
timeout=5,
136136
)
137-
except SerialException as err:
138-
raise StickError(
139-
f"Failed to open serial connection to {serial_path}"
140-
) from err
141-
except TimeoutError as err:
137+
except (SerialException, TimeoutError, TypeError, ValueError) as err:
142138
raise StickError(
143139
f"Failed to open serial connection to {serial_path}"
144140
) from err

0 commit comments

Comments
 (0)