Commits

pvalente  committed 41b05a4

Mudança no tratamento de erros

  • Participants
  • Parent commits 9db4645

Comments (0)

Files changed (1)

File comofas_answers.py

                 
                 try:
                     answer = self.answers_connection.questionSearch({'query':cleaned_question, 'search_in':'question', 'region': REGION, 'type':'resolved', 'results':'1'})
+                except urllib2.HTTPError:
+                    logging.debug("answer exception:" + str(traceback.print_exc()))
+                    continue
+                try:    
                     question['answered'] = True
                     question['answer'] = answer[0]
                     question['twittered'] = False
                     
                     if DEBUG: print question                   
 
-                except:
+                except IndexError:
                     logging.debug("answer exception:" + str(traceback.print_exc()))
                     continue
             self.persist_questions()