File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change 1616import dispatch .sdk .v1 .function_pb2 as function_pb
1717import dispatch .sdk .v1 .poll_pb2 as poll_pb
1818from dispatch .id import DispatchID
19- from dispatch .proto import Status
19+ from dispatch .proto import CallResult , Error , Status
2020from dispatch .test import EndpointClient
2121
2222_default_retry_on_status = {
@@ -172,11 +172,27 @@ def dispatch_calls(self):
172172 if status == Status .OK :
173173 logger .info ("call to function %s succeeded" , request .function )
174174 else :
175- logger .warning (
176- "call to function %s failed (%s)" ,
177- request .function ,
178- status ,
179- )
175+ exc = None
176+ if response .HasField ("exit" ):
177+ if response .exit .HasField ("result" ):
178+ result = response .exit .result
179+ if result .HasField ("error" ):
180+ exc = Error ._from_proto (result .error ).to_exception ()
181+
182+ if exc is not None :
183+ logger .warning (
184+ "call to function %s failed (%s => %s: %s)" ,
185+ request .function ,
186+ status ,
187+ exc .__class__ .__name__ ,
188+ str (exc ),
189+ )
190+ else :
191+ logger .warning (
192+ "call to function %s failed (%s)" ,
193+ request .function ,
194+ status ,
195+ )
180196
181197 if status in self .retry_on_status :
182198 _next_queue .append ((dispatch_id , request , CallType .RETRY ))
You can’t perform that action at this time.
0 commit comments