]> sigrok.org Git - libsigrokdecode.git/blobdiff - util.c
srd: Support for registering a custom log handler.
[libsigrokdecode.git] / util.c
diff --git a/util.c b/util.c
index 75dd83e45996a02ce83ca6d41b8a024ed465bbce..090c0c156d267ecf45d10094fa6347b6de061a2c 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2,7 +2,7 @@
  * This file is part of the sigrok project.
  *
  * Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
- * Copyright (C) 2011 Bert Vermeulen <bert@biot.com>
+ * Copyright (C) 2012 Bert Vermeulen <bert@biot.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -46,8 +46,7 @@ int py_attr_as_str(PyObject *py_obj, const char *attr, char **outstr)
        }
 
        if (!(py_str = PyObject_GetAttrString(py_obj, attr))) {
-               /* TODO: report exception message/traceback to err/dbg */
-               PyErr_Clear();
+               catch_exception("");
                return SRD_ERR_PYTHON;
        }
 
@@ -149,9 +148,7 @@ err_out:
                Py_XDECREF(py_encstr);
 
        if (PyErr_Occurred()) {
-               srd_dbg("srd: string conversion failed");
-               /* TODO: dump exception to srd_dbg */
-               PyErr_Clear();
+               catch_exception("string conversion failed");
        }
 
        return ret;