diff options
Diffstat (limited to 'src/vpp-api/python')
-rw-r--r-- | src/vpp-api/python/vpp_papi/vpp_transport_shmem.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_transport_shmem.py b/src/vpp-api/python/vpp_papi/vpp_transport_shmem.py index 53ae775069f..64c1a59ba74 100644 --- a/src/vpp-api/python/vpp_papi/vpp_transport_shmem.py +++ b/src/vpp-api/python/vpp_papi/vpp_transport_shmem.py @@ -48,7 +48,13 @@ def vac_error_handler(arg, msg, msg_len): class VppTransportShmemIOError(IOError): - pass + """ exception communicating with vpp over shared memory """ + + def __init__(self, rv, descr): + self.rv = rv + self.desc = descr + + super(VppTransportShmemIOError, self).__init__(rv, descr) class VppTransport(object): @@ -117,7 +123,8 @@ class VppTransport(object): size = ffi.new("int *") rv = vpp_api.vac_read(mem, size, self.read_timeout) if rv: - raise VppTransportShmemIOError(rv, 'vac_read failed') + strerror = 'vac_read failed. It is likely that VPP died.' + raise VppTransportShmemIOError(rv, strerror) msg = bytes(ffi.buffer(mem[0], size[0])) vpp_api.vac_free(mem[0]) return msg |