Browse Source

[2887] catch all exceptions in RRset_addRdata.

this is necessary anyway, but in particular helps avoid ugly crash
due to buggy Python code on FreeBSD 9.1.
JINMEI Tatuya 12 years ago
parent
commit
23af78de3f
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/lib/dns/python/rrset_python.cc

+ 9 - 1
src/lib/dns/python/rrset_python.cc

@@ -293,8 +293,16 @@ RRset_addRdata(PyObject* self, PyObject* args) {
         PyErr_Clear();
         PyErr_SetString(PyExc_TypeError,
                         "Rdata type to add must match type of RRset");
-        return (NULL);
+    } catch (const exception& ex) {
+        const string ex_what =
+            "Unexpected failure adding rrset Rdata: " +
+            string(ex.what());
+        PyErr_SetString(po_IscException, ex_what.c_str());
+    } catch (...) {
+        PyErr_SetString(PyExc_SystemError,
+                        "Unexpected failure adding rrset Rdata");
     }
+    return (NULL);
 }
 
 PyObject*