X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=type_decoder.c;h=86ccf02ea7fcd46a3d7626b7f8992e2695962adf;hp=ab5182f0112a3cc522f594b0846847fa4bfe06ad;hb=9d9fcb375d7702082146bf917a5d19cc83480eae;hpb=d906d3f978233458fc73b56fb232352affd1b433 diff --git a/type_decoder.c b/type_decoder.c index ab5182f..86ccf02 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -126,8 +126,7 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) Py_XINCREF(next_di->py_instance); if (!(py_res = PyObject_CallMethod(next_di->py_instance, "decode", "KKO", start_sample, end_sample, data))) { - if (PyErr_Occurred()) - PyErr_Print(); + catch_exception("calling %s decode(): ", next_di->instance_id); } Py_XDECREF(py_res); } @@ -155,14 +154,13 @@ static PyObject *Decoder_add(PyObject *self, PyObject *args) int output_type, pdo_id; if (!(di = get_di_by_decobject(self))) { - srd_dbg("srd: %s():%d decoder instance not found", __func__, __LINE__); + srd_dbg("srd: decoder instance not found"); PyErr_SetString(PyExc_Exception, "decoder instance not found"); return NULL; } if (!PyArg_ParseTuple(args, "is", &output_type, &proto_id)) { - if (PyErr_Occurred()) - PyErr_Print(); + catch_exception(""); return NULL; }