Skip to content

Commit

Permalink
"Fixed" uncaught exception issue (by just replacing the problematic file
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByDrescher committed Sep 11, 2024
1 parent 0a31023 commit 32b379a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vcell-cli/src/main/java/org/vcell/cli/run/OmexHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import de.unirostock.sems.cbarchive.CombineArchiveException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdom2.IllegalNameException;
import org.jdom2.JDOMException;
import org.vcell.cli.CLIUtils;

Expand Down Expand Up @@ -52,9 +53,9 @@ public OmexHandler(String omexPath, String outDir) throws IOException {
if ((initiallyEncounteredErrors && omexFile.canWrite() && initialArchive.getErrors().contains(".rdf"))
|| initialArchive.getEntries().stream().map(ArchiveEntry::getFileName).noneMatch(name->name.endsWith(".rdf")))
this.replaceMetadataRdfFiles(Paths.get(omexPath)); // Replace the offending files
} catch (CombineArchiveException | JDOMException | ParseException e) {
} catch (CombineArchiveException | JDOMException | IllegalNameException | ParseException e) {
// Alright, we got errors, AND an exception. Let's try a hail mary.
if (omexFile.canWrite() && e.getMessage().contains(".rdf"))
if (omexFile.canWrite())
this.replaceMetadataRdfFiles(Paths.get(omexPath));
}

Expand Down
Binary file modified vcell-cli/src/test/resources/BioModel1.omex
Binary file not shown.

0 comments on commit 32b379a

Please sign in to comment.