Commit 4918f572 by maarten

nested werkt blijkbaar toch anders... jammmer

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@375 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent 0119c93a
......@@ -1925,7 +1925,8 @@ void Row::assign(const string& name, const string& value, bool emplacing)
}
catch (const exception& ex)
{
throw_with_nested(logic_error("Could not assigning value '" + value + "' to column " + name));
cerr << "Could not assigning value '" << value << "' to column " << name << endl;
throw;
}
}
......@@ -2264,7 +2265,8 @@ File::File(boost::filesystem::path p, bool validate)
}
catch (const exception& ex)
{
throw_with_nested("Error while loading file " + p.string());
cerr << "Error while loading file " << p << endl;
throw;
}
}
......@@ -2334,7 +2336,8 @@ void File::load(fs::path p)
}
catch (const exception& ex)
{
throw_with_nested(runtime_error("Error loading file " + p.string()));
cerr << "Error loading file " << p << endl;
throw;
}
}
......
......@@ -905,7 +905,8 @@ void DictParser::loadDictionary()
}
catch (const exception& ex)
{
throw_with_nested(runtime_error("Error parsing dictionary"));
cerr << "Error parsing dictionary" << endl;
throw;
}
// store all validators
......
......@@ -419,9 +419,10 @@ Compound::Compound(const fs::path& file, const std::string& id,
i->atomID.push_back(atom_id);
}
}
catch (...)
catch (const exception& ex)
{
throw_with_nested(runtime_error("Error loading ccp4 file for " + id + " from file " + file.string()));
cerr << "Error loading ccp4 file for " << id << " from file " << file << endl;
throw;
}
}
......@@ -1339,7 +1340,8 @@ void CompoundFactory::pushDictionary(const string& inDictFile)
}
catch (const exception& ex)
{
throw_with_nested(runtime_error("When trying to load dictionary file " + inDictFile));
cerr << "Error loading dictionary " << inDictFile << endl;
throw;
}
}
......
......@@ -224,9 +224,10 @@ int PDBRecord::vI(int columnFirst, int columnLast)
}
}
}
catch (...)
catch (const exception& ex)
{
throw_with_nested(runtime_error("Trying to parse '" + string(mValue + columnFirst - 7, mValue + columnLast - 7) + '\''));
cerr << "Trying to parse '" << string(mValue + columnFirst - 7, mValue + columnLast - 7) << '\'' << endl;
throw;
}
if (negate)
......@@ -629,7 +630,7 @@ class PDBFileParser
{
return mChainSeq2AsymSeq.at(key);
}
catch (...)
catch (const exception& ex)
{
throw_with_nested(runtime_error(string("Residue ") + chainID + to_string(resSeq) + iCode + " could not be mapped"));
}
......@@ -1085,7 +1086,7 @@ void PDBFileParser::PreParseInput(istream& is)
{
compNr = stoi(value.substr(1, 3));
}
catch (...)
catch (const exception& ex)
{
throw_with_nested(runtime_error("Invalid component number '" + value.substr(1, 3) + '\''));
}
......@@ -1108,9 +1109,10 @@ void PDBFileParser::PreParseInput(istream& is)
throw_with_nested(runtime_error("Invalid component number '" + lookahead.substr(7, 3) + '\''));
}
}
catch (...)
catch (const exception& ex)
{
throw_with_nested(runtime_error("When parsing FORMUL at line " + to_string(lineNr)));
cerr << "Error parsing FORMUL at line " << lineNr << endl;
throw;
}
}
else if (type == "HETNAM" or
......@@ -2555,7 +2557,8 @@ void PDBFileParser::ParseRemarks()
}
catch (const exception& ex)
{
throw_with_nested(runtime_error("Error parsing REMARK " + to_string(remarkNr)));
cerr << "Error parsing REMARK " << remarkNr << endl;
throw;
}
}
......@@ -5274,7 +5277,8 @@ void PDBFileParser::Parse(istream& is, cif::File& result)
}
catch (const exception& ex)
{
throw_with_nested(runtime_error("Error parsing REMARK 3"));
cerr << "Error parsing REMARK 3" << endl;
throw;
}
//
// auto cat = getCategory("pdbx_refine_tls_group");
......@@ -5305,10 +5309,8 @@ void PDBFileParser::Parse(istream& is, cif::File& result)
}
catch (const exception& ex)
{
if (mRec != nullptr)
throw_with_nested(runtime_error("Error parsing PDB at line " + to_string(mRec->mLineNr)));
else
throw;
cerr << "Error parsing PDB at line " << mRec->mLineNr << endl;
throw;
}
}
......
......@@ -103,7 +103,8 @@ void FileImpl::load(fs::path p)
}
catch (const exception& ex)
{
throw_with_nested(runtime_error("Error trying to load file " + p.string()));
cerr << "Error trying to load file " << p << endl;
throw;
}
// Yes, we've parsed the data. Now locate the datablock.
......
Markdown is supported
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