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

Fixed bug raising AttributeError instead of a descriptive error of the actual problem #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yscumc
Copy link

@yscumc yscumc commented Sep 4, 2013

Sample soap response which triggered this:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="158" MinorBuildNumber="1" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
            <!--
            <m:GetItemResponseMessage>
            ...
            </m:GetItemResponseMessage>
            -->
            <m:GetItemResponseMessage ResponseClass="Error">
               <m:MessageText>An internal server error occurred. Try again later.</m:MessageText>
               <m:ResponseCode>ErrorInternalServerTransientError</m:ResponseCode>
               <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
               <m:Items/>
            </m:GetItemResponseMessage>
            <!--
            <m:GetItemResponseMessage>
            ...
            </m:GetItemResponseMessage>
            -->
         </m:ResponseMessages>
      </m:GetItemResponse>
   </s:Body>
</s:Envelope>

Original stack trace

...
  File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 432, in listCalendarEvent
    return self.listItems(type, id, start, end, on_behalf, shape, categories, folder_id=folder_id)
  File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 1330, in listItems
    extended_items = self.listItems(type="CALENDAR", id=ids, additional=additional)
  File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 1149, in listItems
    (rspcode, msg.MessageText))
AttributeError: 'list' object has no attribute 'MessageText'

Stack trace after fix applied:

Traceback (most recent call last):
...
  File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 432, in listCalendarEvent
    return self.listItems(type, id, start, end, on_behalf, shape, categories, folder_id=folder_id)
  File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 1330, in listItems
    extended_items = self.listItems(type="CALENDAR", id=ids, additional=additional)
  File "C:\Python27\lib\site-packages\EWSWrapper_py\EWSWrapper.py", line 1149, in listItems
    (rspcode, el.MessageText))
Exception: Error code: ErrorInternalServerTransientError message: An internal server error occurred. Try again later.

…e actual problem

Sample soap response which triggered this:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="158" MinorBuildNumber="1" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
            <!--
            <m:GetItemResponseMessage>
            ...
            </m:GetItemResponseMessage>
            -->
            <m:GetItemResponseMessage ResponseClass="Error">
               <m:MessageText>An internal server error occurred. Try again later.</m:MessageText>
               <m:ResponseCode>ErrorInternalServerTransientError</m:ResponseCode>
               <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
               <m:Items/>
            </m:GetItemResponseMessage>
            <!--
            <m:GetItemResponseMessage>
            ...
            </m:GetItemResponseMessage>
            -->
         </m:ResponseMessages>
      </m:GetItemResponse>
   </s:Body>
</s:Envelope>
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

Successfully merging this pull request may close these issues.

1 participant