Sfoglia il codice sorgente

add info about CIF export failure

dsehnal 3 anni fa
parent
commit
f70a10bc56
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  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) {