comparison rdf/RDFFeatureWriter.cpp @ 599:f3211e01b315

* use exceptions instead of exit()!
author Chris Cannam
date Tue, 07 Jul 2009 10:54:10 +0000
parents 4fa2b135acbc
children 02d9664906e8
comparison
equal deleted inserted replaced
598:939ffbc32d50 599:f3211e01b315
15 15
16 #include <fstream> 16 #include <fstream>
17 17
18 #include "vamp-hostsdk/PluginHostAdapter.h" 18 #include "vamp-hostsdk/PluginHostAdapter.h"
19 #include "vamp-hostsdk/PluginLoader.h" 19 #include "vamp-hostsdk/PluginLoader.h"
20
21 #include "base/Exceptions.h"
20 22
21 #include "RDFFeatureWriter.h" 23 #include "RDFFeatureWriter.h"
22 #include "RDFTransformFactory.h" 24 #include "RDFTransformFactory.h"
23 #include "PluginRDFIndexer.h" 25 #include "PluginRDFIndexer.h"
24 26
157 QTextStream *stream = getOutputStream(trackId, transform.getIdentifier()); 159 QTextStream *stream = getOutputStream(trackId, transform.getIdentifier());
158 if (!stream) { 160 if (!stream) {
159 std::cerr << "RDFFeatureWriter::write: ERROR: No output stream for track id \"" 161 std::cerr << "RDFFeatureWriter::write: ERROR: No output stream for track id \""
160 << trackId.toStdString() << "\" and transform \"" 162 << trackId.toStdString() << "\" and transform \""
161 << transform.getIdentifier().toStdString() << "\"" << std::endl; 163 << transform.getIdentifier().toStdString() << "\"" << std::endl;
162 exit(1); 164 throw FileOperationFailed("", "output stream write");
163 } 165 }
164 166
165 if (m_startedStreamTransforms.find(stream) == 167 if (m_startedStreamTransforms.find(stream) ==
166 m_startedStreamTransforms.end()) { 168 m_startedStreamTransforms.end()) {
167 // cerr << "This stream is new, writing prefixes" << endl; 169 // cerr << "This stream is new, writing prefixes" << endl;