Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I know what's the problem about connections #68

Open
voostar opened this issue Jun 14, 2016 · 2 comments
Open

How can I know what's the problem about connections #68

voostar opened this issue Jun 14, 2016 · 2 comments

Comments

@voostar
Copy link

voostar commented Jun 14, 2016

While I try to create an event at start using pyexchange:

AttributeError Traceback (most recent call last)
in ()
31
32 # Connect to Exchange and create the event
---> 33 event.create()

/usr/local/lib/python2.7/dist-packages/pyexchange/exchange2010/init.pyc in create(self)
260 body = soap_request.new_event(self)
261
--> 262 response_xml = self.service.send(body)
263 self._id, self._change_key = self._parse_id_and_change_key_from_response(response_xml)
264

/usr/local/lib/python2.7/dist-packages/pyexchange/base/soap.pyc in send(self, xml, headers, retries, timeout, encoding)
32 request_xml = self._wrap_soap_xml_request(xml)
33 log.info(etree.tostring(request_xml, encoding=encoding, pretty_print=True))
---> 34 response = self._send_soap_request(request_xml, headers=headers, retries=retries, timeout=timeout, encoding=encoding)
35 return self._parse(response, encoding=encoding)
36

/usr/local/lib/python2.7/dist-packages/pyexchange/exchange2010/init.pyc in _send_soap_request(self, body, headers, retries, timeout, encoding)
42 "Content-type": "text/xml; charset=%s " % encoding
43 }
---> 44 return super(Exchange2010Service, self)._send_soap_request(body, headers=headers, retries=retries, timeout=timeout, encoding=encoding)
45
46 def _check_for_errors(self, xml_tree):

/usr/local/lib/python2.7/dist-packages/pyexchange/base/soap.pyc in _send_soap_request(self, xml, headers, retries, timeout, encoding)
63 body = etree.tostring(xml, encoding=encoding)
64
---> 65 response = self.connection.send(body, headers, retries, timeout)
66 return response
67

/usr/local/lib/python2.7/dist-packages/pyexchange/connection.pyc in send(self, body, headers, retries, timeout, encoding)
65 response.raise_for_status()
66 except requests.exceptions.RequestException as err:
---> 67 log.debug(err.response.content)
68 raise FailedExchangeException(u'Unable to connect to Exchange: %s' % err)
69

AttributeError: 'NoneType' object has no attribute 'content'

It connect to company's exchange server and Lightning is working. So I wondering how can I trouble shooting about the connections?

@voostar
Copy link
Author

voostar commented Jun 16, 2016

I found that responses doesn't have content attribute. So why log it at line 67? After I committed line 67 then I got the error message to know the root cause.

@fedorareis
Copy link

line 67 should only have err.response. It as response is the content of the error. The .content portion at the end causes an error about the response not having content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants