File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- from flask_cors .decorator import cross_origin
21import werkzeug
32
43from werkzeug .utils import cached_property
1817class Search (Resource ):
1918 @search_ns .doc (responses = {
2019 200 : 'OK' ,
21- 400 : 'BAD REQUEST ' ,
20+ 404 : 'NO RESULT FOUND ' ,
2221 500 : 'INTERNAL SERVER ERROR'
2322 })
2423 @search_ns .doc (description = 'Searches for keyword on Twitter through stream listener' )
@@ -28,9 +27,9 @@ def post(self):
2827 try :
2928 return SearchResultParser ().search_result_parser (keyword ), 200
3029 except errors .EmptyDataError :
31- return 404
30+ return 'NO RESULT FOUND' , 404
3231 except :
33- return 500
32+ return 'INTERNAL SERVER ERROR' , 500
3433
3534@search_ns .route ('/trending-topics' )
3635class SearchTrendingTopics (Resource ):
@@ -44,4 +43,4 @@ def get(self):
4443 try :
4544 return SearchResultParser ().trending_topics_parser (23424768 ), 200
4645 except :
47- return 500
46+ return 'INTERNAL SERVER ERROR' , 500
You can’t perform that action at this time.
0 commit comments