@@ -170,7 +170,11 @@ def transcoder_put_str(input_ari: str):
170170
171171
172172# PUT /ui/incoming_send/str Body is str ARI to send to transcoder
173- @router .put ("/ui/incoming_send/str" , status_code = status .HTTP_200_OK )
173+ @router .put ("/ui/incoming_send/str" , status_code = status .HTTP_200_OK ,
174+ responses = {
175+ status .HTTP_500_INTERNAL_SERVER_ERROR : {"description" : "Error response from NM" },
176+ status .HTTP_504_GATEWAY_TIMEOUT : {"description" : "Manager response timed out" }
177+ })
174178async def transcoder_send_ari_str (eid : str , ari : str ):
175179 try :
176180 # Perform translation (API wrapper)
@@ -187,13 +191,13 @@ async def transcoder_send_ari_str(eid: str, ari: str):
187191 if info .parsed_as != "pending" :
188192 break
189193 if retries <= 0 :
190- raise HTTPException (status_code = 504 ,
194+ raise HTTPException (status_code = status . HTTP_504_GATEWAY_TIMEOUT ,
191195 detail = { "idinfo" : idinfo , "info" : info , "status" : "transcoder timeout" })
192196
193197 retries -= 1
194198
195199 if info .parsed_as == "ERROR" :
196- raise HTTPException (status_code = 500 ,
200+ raise HTTPException (status_code = status . HTTP_500_INTERNAL_SERVER_ERROR ,
197201 detail = { "idinfo" : idinfo , "info" : info , "status" : 500 })
198202
199203 # Publish
@@ -204,6 +208,7 @@ async def transcoder_send_ari_str(eid: str, ari: str):
204208 raise e
205209 except Exception as e :
206210 logger .exception (e )
207- return status .HTTP_500_INTERNAL_SERVER_ERROR
211+ raise HTTPException (status_code = status .HTTP_500_INTERNAL_SERVER_ERROR )
212+
208213
209214
0 commit comments