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

Handle exceptions thrown by create_stream_writer, create_path_writer,...

Handle exceptions thrown by create_stream_writer, create_path_writer, create_stream_reader, create_path_reader
parent ec1b1e22
Branches
No related merge requests found
......@@ -30,11 +30,27 @@ namespace Corpus2 {
virtual ~TokenReader();
/* --------------------------------------------------------------------- */
%exception {
try {
$action
} catch (PwrNlp::PwrNlpError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
static TokenReaderPtr create_path_reader(
const std::string& class_id,
const Tagset& tagset,
const std::string& path);
%exception {
try {
$action
} catch (PwrNlp::PwrNlpError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
static TokenReaderPtr create_stream_reader(
const std::string& class_id,
const Tagset& tagset,
......
......@@ -39,11 +39,27 @@ namespace Corpus2 {
void finish();
/* --------------------------------------------------------------------- */
%exception {
try {
$action
} catch (PwrNlp::PwrNlpError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
static TokenWriterPtr create_stream_writer(
const std::string& class_id_params,
std::ostream& os, const Tagset&
tagset);
%exception {
try {
$action
} catch (PwrNlp::PwrNlpError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
static TokenWriterPtr create_path_writer(
const std::string& class_id_params,
const std::string& path,
......
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