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 16
16
import dispatch .sdk .v1 .function_pb2 as function_pb
17
17
import dispatch .sdk .v1 .poll_pb2 as poll_pb
18
18
from dispatch .id import DispatchID
19
- from dispatch .proto import Status
19
+ from dispatch .proto import CallResult , Error , Status
20
20
from dispatch .test import EndpointClient
21
21
22
22
_default_retry_on_status = {
@@ -172,11 +172,27 @@ def dispatch_calls(self):
172
172
if status == Status .OK :
173
173
logger .info ("call to function %s succeeded" , request .function )
174
174
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
+ )
180
196
181
197
if status in self .retry_on_status :
182
198
_next_queue .append ((dispatch_id , request , CallType .RETRY ))
You can’t perform that action at this time.
0 commit comments