} catch (const isc::InvalidParameter& ip) {
PyErr_Clear();
PyErr_SetString(po_InvalidParameter, ip.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.get_header_flag(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in getHeaderFlag");
- return (NULL);
+ "Unexpected exception in Message.get_header_flag()");
}
+ return (NULL);
}
PyObject*
} catch (const InvalidMessageOperation& imo) {
PyErr_Clear();
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
} catch (const isc::InvalidParameter& ip) {
PyErr_Clear();
PyErr_SetString(po_InvalidParameter, ip.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.set_header_flag(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in setHeaderFlag");
- return (NULL);
+ "Unexpected exception in Message.set_header_flag()");
}
+ return (NULL);
}
PyObject*
Py_RETURN_NONE;
} catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.get_qid(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in setQid");
- return (NULL);
+ "Unexpected exception in Message.set_qid()");
}
+ return (NULL);
}
PyObject*
return (createRcodeObject(self->cppobj->getRcode()));
} catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.get_rcode(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
- PyErr_SetString(po_IscException, "Unexpected exception");
- return (NULL);
+ PyErr_SetString(po_IscException,
+ "Unexpected exception in Message.get_rcode()");
}
+ return (NULL);
}
PyObject*
Py_RETURN_NONE;
} catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.set_rcode(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in setRcode");
- return (NULL);
+ "Unexpected exception in Message.set_rcode()");
}
+ return (NULL);
}
PyObject*
return (createOpcodeObject(self->cppobj->getOpcode()));
} catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
} catch (const exception& ex) {
- const string ex_what =
- "Failed to get message opcode: " + string(ex.what());
+ const string ex_what = "Error in Message.get_opcode(): " + string(ex.what());
PyErr_SetString(po_IscException, ex_what.c_str());
- return (NULL);
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception getting opcode from message");
- return (NULL);
+ "Unexpected exception in Message.get_opcode()");
}
+ return (NULL);
}
PyObject*
Py_RETURN_NONE;
} catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.set_opcode(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in setOpcode");
- return (NULL);
+ "Unexpected exception in Message.set_opcode()");
}
+ return (NULL);
}
PyObject*
try {
return (createEDNSObject(*src));
} catch (const exception& ex) {
- const string ex_what =
- "Failed to get EDNS from message: " + string(ex.what());
+ const string ex_what = "Error in Message.get_edns(): " + string(ex.what());
PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(PyExc_SystemError,
- "Unexpected failure getting EDNS from message");
+ "Unexpected exception in Message.get_edns()");
}
return (NULL);
}
Py_RETURN_NONE;
} catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.set_edns(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in setEDNS");
- return (NULL);
+ "Unexpected exception in Message.set_edns()");
}
+ return (NULL);
}
PyObject*
} catch (const InvalidMessageOperation& ex) {
PyErr_SetString(po_InvalidMessageOperation, ex.what());
} catch (const exception& ex) {
- const string ex_what =
- "Unexpected failure in getting TSIGRecord from message: " +
- string(ex.what());
+ const string ex_what = "Error in Message.get_tsig_record(): " + string(ex.what());
PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
- PyErr_SetString(PyExc_SystemError, "Unexpected failure in "
- "getting TSIGRecord from message");
+ PyErr_SetString(po_IscException,
+ "Unexpected exception in Message.get_tsig_record()");
}
return (NULL);
}
static_cast<Message::Section>(section))));
} catch (const isc::OutOfRange& ex) {
PyErr_SetString(PyExc_OverflowError, ex.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.get_rr_count(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in getRRCount");
- return (NULL);
+ "Unexpected exception in Message.get_rr_count()");
}
+ return (NULL);
}
// This is a helper templated class commonly used for getQuestion and
} catch (const InvalidMessageSection& ex) {
PyErr_SetString(po_InvalidMessageSection, ex.what());
} catch (const exception& ex) {
- const string ex_what =
- "Unexpected failure in Message.get_question: " +
- string(ex.what());
+ const string ex_what = "Error in Message.get_question(): " + string(ex.what());
PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
- PyErr_SetString(PyExc_SystemError,
- "Unexpected failure in Message.get_question");
+ PyErr_SetString(po_IscException,
+ "Unexpected exception in Message.get_question()");
}
return (NULL);
}
} catch (const InvalidMessageSection& ex) {
PyErr_SetString(po_InvalidMessageSection, ex.what());
} catch (const exception& ex) {
- const string ex_what =
- "Unexpected failure in Message.get_section: " +
- string(ex.what());
+ const string ex_what = "Error in Message.get_section(): " + string(ex.what());
PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
- PyErr_SetString(PyExc_SystemError,
- "Unexpected failure in Message.get_section");
+ PyErr_SetString(po_IscException,
+ "Unexpected exception in Message.get_section()");
}
return (NULL);
}
} catch (const InvalidMessageOperation& imo) {
PyErr_Clear();
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.add_question(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in addQuestion");
- return (NULL);
+ "Unexpected exception in Message.add_question()");
}
+ return (NULL);
}
PyObject*
Py_RETURN_NONE;
} catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
} catch (const isc::OutOfRange& ex) {
PyErr_SetString(PyExc_OverflowError, ex.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.add_rrset(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in adding RRset");
- return (NULL);
+ "Unexpected exception in Message.add_rrset()");
}
+ return (NULL);
}
PyObject*
return (NULL);
}
}
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.clear(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception when clearing message");
+ "Unexpected exception in Message.clear()");
}
return (NULL);
}
Py_RETURN_NONE;
} catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
} catch (const isc::OutOfRange& ex) {
PyErr_SetString(PyExc_OverflowError, ex.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.clear_section(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
PyErr_SetString(po_IscException,
- "Unexpected exception in clearSection");
- return (NULL);
+ "Unexpected exception in Message.clear_section()");
}
+ return (NULL);
}
PyObject*
} catch (const InvalidMessageOperation& imo) {
PyErr_Clear();
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.make_response(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
- PyErr_SetString(po_IscException, "Unexpected exception in Message.makeResponse");
- return (NULL);
+ PyErr_SetString(po_IscException,
+ "Unexpected exception in Message.make_response()");
}
+ return (NULL);
}
PyObject*
} catch (const InvalidMessageOperation& imo) {
PyErr_Clear();
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.to_text(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
- PyErr_SetString(po_IscException, "Unexpected exception");
- return (NULL);
+ PyErr_SetString(po_IscException,
+ "Unexpected exception in Message.to_text()");
}
+ return (NULL);
}
PyObject*
} catch (const InvalidMessageOperation& imo) {
PyErr_Clear();
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
} catch (const TSIGContextError& ex) {
// toWire() with a TSIG context can fail due to this if the
// python program has a bug.
PyErr_SetString(po_TSIGContextError, ex.what());
- return (NULL);
- } catch (const std::exception& ex) {
- // Other exceptions should be rare (most likely an implementation
- // bug)
- PyErr_SetString(po_TSIGContextError, ex.what());
- return (NULL);
+ } catch (const exception& ex) {
+ const string ex_what = "Error in Message.to_wire(): " + string(ex.what());
+ PyErr_SetString(po_TSIGContextError, ex_what.c_str());
} catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Unexpected C++ exception in Message.to_wire");
- return (NULL);
+ PyErr_SetString(po_IscException,
+ "Unexpected exception in Message.to_wire()");
}
+ return (NULL);
}
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
Py_RETURN_NONE;
} catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
- return (NULL);
} catch (const DNSMessageFORMERR& dmfe) {
PyErr_SetString(po_DNSMessageFORMERR, dmfe.what());
- return (NULL);
} catch (const DNSMessageBADVERS& dmfe) {
PyErr_SetString(po_DNSMessageBADVERS, dmfe.what());
- return (NULL);
} catch (const MessageTooShort& mts) {
PyErr_SetString(po_MessageTooShort, mts.what());
- return (NULL);
} catch (const InvalidBufferPosition& ex) {
PyErr_SetString(po_DNSMessageFORMERR, ex.what());
- return (NULL);
} catch (const exception& ex) {
- const string ex_what =
- "Error in Message.from_wire: " + string(ex.what());
- PyErr_SetString(PyExc_RuntimeError, ex_what.c_str());
- return (NULL);
+ const string ex_what = "Error in Message.from_wire(): " + string(ex.what());
+ PyErr_SetString(po_IscException, ex_what.c_str());
} catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Unexpected exception in Message.from_wire");
- return (NULL);
+ PyErr_SetString(po_IscException,
+ "Unexpected exception in Message.from_wire()");
}
+ return (NULL);
}
PyErr_SetString(PyExc_TypeError,