Skip to content

Commit

Permalink
fix(example): unknown action
Browse files Browse the repository at this point in the history
Fix an issue with an 'unknown action' error being raised due to the
branch not returning from the function.

Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Oct 31, 2023
1 parent 887d5e5 commit 03462ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/src/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03462ca

Please sign in to comment.