diff --git a/modules/io/src/mol/mmcif_writer.cc b/modules/io/src/mol/mmcif_writer.cc
index 230e4e35912174db0ce299323bc5c44380243be0..ecd5ba7d5d0b020670fd222505297c18c7c8aeda 100644
--- a/modules/io/src/mol/mmcif_writer.cc
+++ b/modules/io/src/mol/mmcif_writer.cc
@@ -713,7 +713,13 @@ namespace {
       for(auto res: res_list) {
         int num = res.GetNumber().GetNum();
         if(num < 1) {
-          throw "asdf";
+          std::stringstream ss;
+          ss << "Try to construct mmCIF entity from residues using resnum ";
+          ss << "based alignments. Negative residue numbers are not allowed ";
+          ss << "in this case. Got: " << num << " in residue " << res;
+          ss << ". You may set mmcif_conform flag to False to write something ";
+          ss << "but be aware of the consequences...";
+          throw ost::io::IOException(ss.str());
         }
         res_mon_ids.push_back(res.GetName());
         resnums.push_back(num);