Browse Source

improved error handling

Andreas Kopmann 6 years ago
parent
commit
35edc3b0ab
1 changed files with 1 additions and 1 deletions
  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"