Skip to content

Commit

Permalink
Merged in lazerscience/gevent-websocket (pull request #17)
Browse files Browse the repository at this point in the history
Adding method _get_exception_info to WAMP Protocol class
  • Loading branch information
jgelens committed Apr 24, 2014
2 parents c831714 + 77df1f3 commit cb5065f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions geventwebsocket/protocols/wamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ def do_handshake(self):
]
self.app.ws.send(serialize(welcome))

def _get_exception_info(self, e):
uri = 'http://TODO#generic'
desc = str(type(e))
details = str(e)
return [uri, desc, details]

def rpc_call(self, data):
call_id, curie_or_uri = data[1:3]
args = data[3:]
Expand All @@ -174,8 +180,7 @@ def rpc_call(self, data):
result_msg = [self.MSG_CALL_RESULT, call_id, result]
except Exception, e:
result_msg = [self.MSG_CALL_ERROR,
call_id, 'http://TODO#generic',
str(type(e)), str(e)]
call_id] + self._get_exception_info(e)

self.app.on_message(serialize(result_msg))

Expand Down

0 comments on commit cb5065f

Please sign in to comment.