From 973d7e946a9414576fc520cd19f861de3e60bedc Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Sun, 31 Dec 2023 15:46:04 +0100
Subject: [PATCH] mmcif writer: clarify error message

---
 modules/io/src/mol/mmcif_writer.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/io/src/mol/mmcif_writer.cc b/modules/io/src/mol/mmcif_writer.cc
index 785c3aabe..d682b13ff 100644
--- a/modules/io/src/mol/mmcif_writer.cc
+++ b/modules/io/src/mol/mmcif_writer.cc
@@ -1263,8 +1263,11 @@ namespace {
           Feed_atom_site(atom_site, chain_name, entity_id, entity_info[entity_id],
                          tmp);
         } else {
-          // TODO: make error message more insightful...
-          throw ost::io::IOException("Unsupported chem class...");
+          // this should not happen...
+          std::stringstream ss;
+          ss << "Unsupported chem class (" << res.GetChemClass();
+          ss << ") for residue "<< res;
+          throw ost::io::IOException(ss.str());
         }
       }
 
-- 
GitLab