From 12ff88a7c5d1547ec2e3dbed5af43c8d8562fa26 Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Tue, 31 Oct 2023 12:05:55 +1100 Subject: [PATCH] fix(example): unknown action Fix an issue with an 'unknown action' error being raised due to the branch not returning from the function. Signed-off-by: JP-Ellis --- examples/src/message.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/src/message.py b/examples/src/message.py index 977c343c7b..cab137ec0b 100644 --- a/examples/src/message.py +++ b/examples/src/message.py @@ -61,10 +61,11 @@ def process(self, event: Dict[str, Any]) -> Union[str, None]: if event["action"] == "WRITE": self.fs.write(event["path"], event.get("contents", "")) + return None if event["action"] == "READ": return self.fs.read(event["path"]) - msg = "Invalid action." + msg = f"Invalid action: {event['action']!r}" raise ValueError(msg) @staticmethod