Skip to content
Snippets Groups Projects
Commit c8a58c1c authored by Igor Danielewicz's avatar Igor Danielewicz
Browse files

Swig rethrows c++ runtime exception (xmlp::parse_error) to python.

parent cafe5124
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
%include "token.i"
%include "sentence.i"
%include "exception.i"
%include "corpus2exception.i"
%include "annotationchannel.i"
%include "boost_shared_ptr.i"
......
......@@ -6,7 +6,8 @@
#include <libcorpus2_whole/io/cclrelreader.h>
%}
%include "exception.i"
%include <exception.i>
%include "corpus2exception.i"
%include "document.i"
%include "boost_shared_ptr.i"
......@@ -32,6 +33,10 @@ namespace whole {
} catch (PwrNlp::PwrNlpError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
} catch (xmlpp::parse_error &e) {
std::string s("xmlpp::parse_error: "), s2(e.what());
s = s + s2;
SWIG_exception(SWIG_RuntimeError, s.c_str());
}
}
boost::shared_ptr<Document> read();
......
......@@ -5,7 +5,7 @@
%include "boost_shared_ptr.i"
%include "unicodestring.i"
%include "exception.i"
%include "corpus2exception.i"
%include "annotatedsentence.i"
%include "annotationchannel.i"
%include "annotationview.i"
......
#ifndef SWIG_LIBCORPUS2_EXCEPTION_I
#define SWIG_LIBCORPUS2_EXCEPTION_I
%include <exception.i>
%module libcorpusexception
%{
#include <libcorpus2/exception.h>
......
......@@ -6,7 +6,7 @@
#include <libcorpus2/tagset.h>
%}
%include "tag.i"
%include "exception.i"
%include "corpus2exception.i"
%include "std_defs.i"
%include "std_string.i"
......
......@@ -7,7 +7,7 @@
%}
%include "tagset.i"
%include "exception.i"
%include "corpus2exception.i"
%include "std_string.i"
%include "std_vector.i"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment