Browse Source

improved error handling

Andreas Kopmann 6 năm trước cách đây
mục cha
commit
35edc3b0ab
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      ak_wordpress.py

+ 1 - 1
ak_wordpress.py

@@ -43,8 +43,8 @@ def wordpress_get_post(wpid):
 def wordpress_post_by_scopus(data, category = []):
     """ Create a new post based on the Scopus information """
  
-    coredata = data['abstracts-retrieval-response']['coredata']
     try:
+        coredata = data['abstracts-retrieval-response']['coredata']
         authors = data['abstracts-retrieval-response']['authors']['author']
     except KeyError:
         print "Have not found authors in dataset"