Skip to content
Snippets Groups Projects
Commit a18fc1b0 authored by Paweł Kędzia's avatar Paweł Kędzia
Browse files

Handle Exceptions in docreader wrapper.

parent 1d1f10c9
Branches
No related merge requests found
......@@ -6,13 +6,31 @@
#include <libcorpus2/io/docreader.h>
%}
%include "exception.i"
%include "document.i"
%include "boost_shared_ptr.i"
namespace Corpus2 {
class DocumentReader {
public:
%exception {
try {
$action
} catch (PwrNlp::PwrNlpError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
DocumentReader(const Tagset&, const std::string&, const std::string &);
%exception {
try {
$action
} catch (PwrNlp::PwrNlpError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
boost::shared_ptr<Document> read();
/* --------------------------------------------------------------------- */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment