Project

General

Profile

Bug #23252

Python DPM Client Library Error Message

Added by Beau Harrison 8 days ago. Updated 8 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Python Client Library
Target version:
-
Start date:
09/10/2019
Due date:
% Done:

0%

Estimated time:
Duration:

Description

def _rpc(con, task, msg):
    try:
        pkt = bytearray(msg.marshal())
        (address, reply) = con.request_single(task, pkt, 500)
        return (address, dpm_protocol.unmarshal_reply(iter(reply)))
    except dpm_protocol.ProtocolError as error:
        logging.warning('error unmarshalling reply: %s', error)
        raise acnet.Status.ACNET_RPLYPACK

The exception here accounts only for unmarshalling errors but the

pkt = bytearray(msg.marshal())

line could produce a marshalling error.

History

#1 Updated by Richard Neswold 8 days ago

  • Category set to Python Client Library

I was letting that exception get propagated to the caller. But you're right, someone might want to send binary packets in the rpc call (even though it's not as nice to use as a protocol message.)

#2 Updated by Richard Neswold 8 days ago

So you're saying the try: statement should be moved down two lines?

#3 Updated by Beau Harrison 8 days ago

I dumped this here so I wouldn't forget.

I think moving the try line is appropriate.



Also available in: Atom PDF