Ticket #331 (closed enhancement: fixed)

Opened 4 months ago

Last modified 3 months ago

repr of ErrorFault should contain stacktrace

Reported by: thijs Owned by: nick
Priority: critical Milestone: 0.4
Component: Remoting Version: 0.3.1
Keywords: Cc:

Description

Currently you first need to check the .details property of an ErrorFault where it would be more useful to simply print the stacktrace in that repr?

Attachments

test-331.py (323 bytes) - added by thijs 3 months ago.

Change History

comment:1 Changed 3 months ago by nick

  • status changed from new to accepted

comment:2 Changed 3 months ago by nick

  • keywords review added
  • status changed from accepted to assigned
  • owner changed from nick to thijs

pyamf.remoting.ErrorFault.__repr__ now displays the traceback info (if it exists)

comment:3 Changed 3 months ago by thijs

  • keywords review removed
  • owner changed from thijs to nick

Looks good. Tested with attached client showing the stacktrace:

2008-09-01 22:53:12,341 INFO  [pyamf.remoting.client.RemotingService.0xbaaab0] Creating connection to http://demo.pyamf.org:80
2008-09-01 22:53:12,341 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Referer: None
2008-09-01 22:53:12,342 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] User-Agent: PyAMF/0.4.0
2008-09-01 22:53:12,342 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Adding request service123.getLanguages3()
2008-09-01 22:53:12,343 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Executing single request: /1
2008-09-01 22:53:12,343 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] AMF version: 0
2008-09-01 22:53:12,343 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Client type: 0
2008-09-01 22:53:12,347 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Sending POST request to /gateway/recordset
2008-09-01 22:53:12,369 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Waiting for response...
2008-09-01 22:53:13,068 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Got response status: 200
2008-09-01 22:53:13,068 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Content-Type: application/x-amf
2008-09-01 22:53:13,069 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Content-Length: 518
2008-09-01 22:53:13,069 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Server: Apache
2008-09-01 22:53:13,069 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Read 518 bytes for the response
2008-09-01 22:53:13,072 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Response: <Envelope amfVersion=0 clientType=0>
 (u'/1', <Response status=/onStatus>ErrorFault level=error code=Service.ResourceNotFound description=Unknown service service123.getLanguages3
Traceback:
['Traceback (most recent call last):', '  File "/usr/local/src/pyamf/pyamf/remoting/amf0.py", line 75, in __call__    request.target)', '  File "/usr/local/src/pyamf/pyamf/remoting/gateway/__init__.py", line 364, in getServiceRequest    raise UnknownServiceError, "Unknown service %s" % target', 'UnknownServiceError: Unknown service service123.getLanguages3']</Response>)
</Envelope>
2008-09-01 22:53:13,072 DEBUG [pyamf.remoting.client.RemotingService.0xbaaab0] Removing request: /1
ErrorFault level=error code=Service.ResourceNotFound description=Unknown service service123.getLanguages3
Traceback:
['Traceback (most recent call last):', '  File "/usr/local/src/pyamf/pyamf/remoting/amf0.py", line 75, in __call__    request.target)', '  File "/usr/local/src/pyamf/pyamf/remoting/gateway/__init__.py", line 364, in getServiceRequest    raise UnknownServiceError, "Unknown service %s" % target', 'UnknownServiceError: Unknown service service123.getLanguages3']

Changed 3 months ago by thijs

comment:4 Changed 3 months ago by nick

  • status changed from assigned to closed
  • resolution set to fixed

Merged in r1645.

Note: See TracTickets for help on using tickets.