Skip to content

Commit 427743d

Browse files
recover if pathway kgml file can't be loaded
1 parent 20ebe90 commit 427743d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kegg/kegg.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,11 @@ function parseEntry($lfile)
739739

740740
function parseKGML($lfile)
741741
{
742-
$pathway = simplexml_load_file($lfile) or die("Error: Cannot create object");
742+
$pathway = simplexml_load_file($lfile);
743+
if($pathway === false) {
744+
echo "Error in parsing $lfile".PHP_EOL;
745+
return;
746+
}
743747
$pathway_id = str_replace("path","kegg",$pathway['name']);
744748
$base_id = str_replace("kegg","kegg_resource",$pathway_id).".";
745749

0 commit comments

Comments
 (0)