@@ -440,6 +440,8 @@ async def wait_for_completion_or_create_check_status_response(
440440 lambda : self ._create_http_response (200 , status .to_json ()),
441441 OrchestrationRuntimeStatus .Failed :
442442 lambda : self ._create_http_response (500 , status .to_json ()),
443+ None :
444+ None
443445 }
444446
445447 result = switch_statement .get (status .runtime_status )
@@ -456,6 +458,7 @@ async def wait_for_completion_or_create_check_status_response(
456458 await sleep (sleep_time )
457459 else :
458460 return self .create_check_status_response (request , instance_id )
461+ return self .create_check_status_response (request , instance_id )
459462
460463 async def signal_entity (self , entityId : EntityId , operation_name : str ,
461464 operation_input : Optional [Any ] = None ,
@@ -640,6 +643,7 @@ async def rewind(self,
640643
641644 response = await self ._post_async_request (request_url , None )
642645 status : int = response [0 ]
646+ ex_msg : str = ""
643647 if status == 200 or status == 202 :
644648 return
645649 elif status == 404 :
@@ -648,6 +652,9 @@ async def rewind(self,
648652 elif status == 410 :
649653 ex_msg = "The rewind operation is only supported on failed orchestration instances."
650654 raise Exception (ex_msg )
651- else :
655+ elif isinstance ( response [ 1 ], str ) :
652656 ex_msg = response [1 ]
653657 raise Exception (ex_msg )
658+ else :
659+ ex_msg = "Received unexpected payload from the durable-extension: " + str (response )
660+ raise Exception (ex_msg )
0 commit comments