diff --git a/libcorpus2_whole/io/corpusreader.cpp b/libcorpus2_whole/io/corpusreader.cpp index 8e53a7a88484daa129017074e08ffc75814a60c5..56538ad5115a7ce386243bb1214378502f634a99 100644 --- a/libcorpus2_whole/io/corpusreader.cpp +++ b/libcorpus2_whole/io/corpusreader.cpp @@ -13,8 +13,12 @@ CorpusReader::CorpusReader(const Tagset& tagset, const std::string& corpus_type) boost::shared_ptr<Corpus> CorpusReader::read(const std::string& corpus_file_path) { - boost::shared_ptr<CorpusReaderI> reader = this->get_corpus_reader_by_type(); - return reader->read(corpus_file_path); + try { + boost::shared_ptr<CorpusReaderI> reader = this->get_corpus_reader_by_type(); + return reader->read(corpus_file_path); + } catch(...) { + throw; + } } // diff --git a/libcorpus2_whole/io/corpusreader.h b/libcorpus2_whole/io/corpusreader.h index 633ecbb83a241fe44fc302d13b619a55cd4975f0..dafe17b5496f5ee5b099121db6f3cc16f99048ac 100644 --- a/libcorpus2_whole/io/corpusreader.h +++ b/libcorpus2_whole/io/corpusreader.h @@ -35,7 +35,7 @@ private: private: /// Type of corpus, sets only once in constructor - const std::string& corpus_type_; + const std::string corpus_type_; /// Tagset to use, sets only onece in constructor const Tagset& tagset_;