Browse Source

Minor changes to pub module

spficklin 11 years ago
parent
commit
3ffcddb309
2 changed files with 11 additions and 1 deletions
  1. 7 1
      tripal_pub/includes/importers/AGL.inc
  2. 4 0
      tripal_pub/includes/importers/PMID.inc

+ 7 - 1
tripal_pub/includes/importers/AGL.inc

@@ -333,7 +333,7 @@ function tripal_pub_remote_search_AGL($search_array, $num_to_retrieve, $pager_id
 
     if (!yaz_ccl_parse($yazc, $ccl, $cclresult)) {
       drupal_set_message('Error parsing search string: ' . $cclresult["errorstring"], "error");
-      watchdog('tripal_pub', 'Error: %errstr', array('%errstr' => $cclresult["errorstring"]), WATCHDOG_ERROR);
+      watchdog('tpub_import', 'Error: %errstr', array('%errstr' => $cclresult["errorstring"]), WATCHDOG_ERROR);
       return array();
     }
     $search_str = $cclresult["rpn"];
@@ -374,6 +374,8 @@ function tripal_pub_AGL_count($search_array) {
       $error_msg .= " $additional";
     }
     drupal_set_message("ERROR preparing search at AGL: ($error_no) $error_msg", "error");
+    watchdog('tpub_import', "ERROR preparing search at AGL: (%error_no) %error_msg",
+              array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);
     return 0;
   }
   if (!yaz_wait()) {
@@ -384,6 +386,8 @@ function tripal_pub_AGL_count($search_array) {
       $error_msg .= " $additional";
     }
     drupal_set_message("ERROR waiting on search at AGL: ($error_no) $error_msg", "error");
+    watchdog('tpub_import', "ERROR waiting on search at AGL: (%error_no) %error_msg",
+              array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);
     return 0;
   }
 
@@ -416,6 +420,8 @@ function tripal_pub_AGL_range($search_array, $start = 0, $limit = 10) {
       $error_msg .= " $additional";
     }
     drupal_set_message("ERROR waiting on search at AGL: ($error_no) $error_msg", "error");
+    watchdog('tpub_import', "ERROR waiting on search at AGL: (%error_no) %error_msg",
+              array('%error_no' => $error_no, '%error_msg' => $error_msg), WATCHDOG_ERROR);
     return $pubs;
   }
    

+ 4 - 0
tripal_pub/includes/importers/PMID.inc

@@ -202,6 +202,8 @@ function tripal_pub_PMID_search_init($search_str, $retmax){
   $rfh = fopen($query_url, "r");
   if (!$rfh) {
     drupal_set_message('Could not perform Pubmed query. Cannot connect to Entrez.', 'error');
+    watchdog('tpub_import', "Could not perform Pubmed query. Cannot connect to Entrez.",
+              array(), WATCHDOG_ERROR);
     return 0;
   }
 
@@ -279,6 +281,8 @@ $retmod = 'null', $start = 0, $limit = 10, $args = array()){
   $rfh = fopen($fetch_url, "r");
   if (!$rfh) {
     drupal_set_message('ERROR: Could not perform PubMed query.', 'error');
+    watchdog('tpub_import', "Could not perform PubMed query: %fetch_url.",
+              array('%fetch_url' => $fetch_url), WATCHDOG_ERROR);
     return '';
   }
   $results = '';