fix(gateway): make WriteEngine + converter raise-safe against malformed write commands

This commit is contained in:
PedroHMCosme
2026-07-14 19:18:52 -03:00
parent dcf8369638
commit 86d0f6cf23
4 changed files with 54 additions and 1 deletions

View File

@@ -25,6 +25,8 @@ def to_typed_value(raw, data_type: str):
data_type: 'boolean' | 'int' | 'float' | 'double' | 'string'.
Raises ConversionError on any invalid input (never a bare TypeError).
"""
if not isinstance(data_type, str):
raise ConversionError(f'data_type must be a string, got {type(data_type).__name__}')
dtype = data_type.strip().lower()
try:
if dtype in ('bool', 'boolean'):