Bladeren bron

add info about CIF export failure

dsehnal 3 jaren geleden
bovenliggende
commit
f70a10bc56
1 gewijzigde bestanden met toevoegingen van 8 en 1 verwijderingen
  1. 8 1
      src/extensions/model-export/export.ts

+ 8 - 1
src/extensions/model-export/export.ts

@@ -50,7 +50,14 @@ function _exportHierarchy(plugin: PluginContext, options?: { format?: 'cif' | 'b
                 await new Promise(res => setTimeout(res, 50));
             }
 
-            files.push([name, to_mmCIF(s.model.entryId, s, format === 'bcif', { copyAllCategories: true })]);
+            try {
+                files.push([name, to_mmCIF(s.model.entryId, s, format === 'bcif', { copyAllCategories: true })]);
+            } catch (e) {
+                if (format === 'cif' && s.elementCount > 2000000) {
+                    plugin.log.warn(`[Export] The structure might be too big to be exported as Text CIF, consider using the BinaryCIF format instead.`);
+                }
+                throw e;
+            }
         }
 
         if (files.length === 1) {