File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -129,17 +129,17 @@ async def author_name_to_ssaid(author_name: str) -> Tuple[str, str]:
129129 params = {"query" : author_name , "fields" : "name" , "limit" : 1 },
130130 headers = HEADERS ,
131131 )
132- if response .status_code == 200 :
133- data = response .json ()
134- authors = data .get ("data" , [])
135- if authors :
136- # Return the Semantic Scholar author ID from the first result.
137- return authors [0 ]. get ( "authorId" ) , authors [0 ]. get ( "name" )
132+ response .raise_for_status ()
133+ data = response .json ()
134+ authors = data .get ("data" , [])
135+ if authors :
136+ # Return the Semantic Scholar author ID from the first result.
137+ return authors [0 ][ "authorId" ] , authors [0 ][ "name" ]
138138
139139 logger .error (
140140 f"Error in retrieving name from SS Author ID: { response .status_code } - { response .text } "
141141 )
142- return ('-1' , 'N.A.' )
142+ return ('-1' , 'N.A.' )
143143
144144
145145def determine_paper_input_type (input : str ) -> Literal ["ssid" , "doi" , "title" ]:
You can’t perform that action at this time.
0 commit comments