Browse Source

continue if error pulling EBI lookup

bradfordcondon 6 years ago
parent
commit
4c5748802c
1 changed files with 9 additions and 0 deletions
  1. 9 0
      tripal_chado/includes/TripalImporter/OBOImporter.inc

+ 9 - 0
tripal_chado/includes/TripalImporter/OBOImporter.inc

@@ -1023,6 +1023,11 @@ class OBOImporter extends TripalImporter {
         ['!id' => $id]));
     }
     $results = drupal_json_decode($response->data);
+    if (!$results){
+      $this->logMessage('Error: no data with !url.  The response was: !response', ['!url' => $full_url, '!response' => $response]);
+
+      return FALSE;
+    }
 
     // If EBI sent an error message then throw an error.
     if ($results['error']) {
@@ -1746,6 +1751,10 @@ class OBOImporter extends TripalImporter {
         else {
           $stanza = $this->findEBITerm($id);
 
+          if (!$stanza){
+            return FALSE;
+          }
+
           // Make sure the DBs and CVs exist and are added to our cache.
           $this->addDB($stanza['db_name'][0]);
           $this->addCV($stanza['namespace'][0]);