Skip to content

Edge case uncaught exception in fjagepy send #321

@impala454

Description

@impala454

We encountered an issue with fjagepy where, when sending a message via transport. We think this happened when the modem was disconnected during a send operation and the offending line is here. Trace looked like this:

[action_agent-1]     self.transport.send(datagram_req)
[action_agent-1]   File "/usr/local/lib/python3.10/dist-packages/fjagepy/__init__.py", line 147, in send
[action_agent-1]     self.owner.send(msg)
[action_agent-1]   File "/usr/local/lib/python3.10/dist-packages/fjagepy/__init__.py", line 760, in send
[action_agent-1]     self.socket.sendall((rq + '\n').encode())
[action_agent-1] BrokenPipeError: [Errno 32] Broken pipe

Looking at that code it appears it's using the standard Python socket.sendall() which says it will raise an Exception on error and return None on success. So perhaps a check here would be good before returning True so the user doesn't need to catch the underlying socket exceptions.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions