File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ expected_stdout_lines:
5151 - '== APP == 200'
5252 - '== APP == error occurred'
5353 - '== APP == MY_CODE'
54+ - '== APP == {"message": "error occurred", "errorCode": "MY_CODE"}'
55+ - '== APP == 503'
56+ - '== APP == Internal Server Error'
5457background: true
5558sleep: 5
5659-->
Original file line number Diff line number Diff line change 22import time
33
44from dapr .clients import DaprClient
5+ from dapr .clients .exceptions import DaprHttpError
56
67with DaprClient () as d :
78 req_data = {'id' : 1 , 'message' : 'hello world' }
2930 http_verb = 'POST' ,
3031 data = json .dumps (req_data ),
3132 )
32- except Exception as e :
33- print (e ._message , flush = True )
34- print (e ._error_code , flush = True )
33+ except DaprHttpError as e :
34+ print (e .message , flush = True )
35+ print (e .error_code , flush = True )
36+ print (e .raw_response_bytes , flush = True )
37+ print (str (e .status_code ), flush = True )
38+ print (e .reason , flush = True )
You can’t perform that action at this time.
0 commit comments