Skip to content

Commit 3382a41

Browse files
authored
Merge pull request #62 from serv-c/drgroot-patch-1
fix(worker): missed 4xx handle for unknown method
2 parents a9fd145 + ca8aefc commit 3382a41

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

servc/svc/com/worker/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def run_resolver(
140140
and statuscode.value >= 400
141141
and statuscode.value < 500
142142
):
143-
print("Exiting due to 5xx error", error, flush=True)
143+
print("Exiting due to 4xx error", error, flush=True)
144144
exit(1)
145145

146146
return statuscode, response
@@ -215,6 +215,9 @@ def inputProcessor(self, message: Any) -> StatusCode:
215215
message["id"], "Method not found", StatusCode.METHOD_NOT_FOUND
216216
),
217217
)
218+
if self._config.get(f"conf.{self.name}.exiton4xx"):
219+
print("Exiting due to 4xx error:", "Method not found", flush=True)
220+
exit(1)
218221
return StatusCode.METHOD_NOT_FOUND
219222

220223
continueExecution = evaluate_pre_hooks(

0 commit comments

Comments
 (0)