Skip to content

Commit b8b085c

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent ea8a082 commit b8b085c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

service/routes/dc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ def _respond(api: ApiUtils, config: dict):
137137

138138
try:
139139
data = ReadFile(config).get_data()
140-
except (TypeError, InvalidUsage) as error:
140+
except InvalidUsage:
141+
# Preserve existing InvalidUsage exceptions without re-wrapping
142+
raise
143+
except TypeError as error:
144+
# Wrap unexpected TypeError in InvalidUsage
141145
raise InvalidUsage(error)
142146

143147
if config.get("pretty"):

0 commit comments

Comments
 (0)