Fixed up BotoServerException's use of message #1353

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@pasc
Contributor

pasc commented Feb 24, 2013

The BotoServerException class uses getattr() to check the message variable, but this is never going to work as it inherits from StandardError which defines the same variable.

This commit changes the default behaviour to use the message variable by default instead and add support for handling the now old variable name (error_message).

This change also means that the message variable will be populated by default which people generally expect when dealing with exceptions (it's currently not).

@@ -76,7 +76,7 @@ def __init__(self, status, reason, body=None, *args):
self.body = body or ''
self.request_id = None
self.error_code = None
- self.error_message = None
+ self._error_message = None

This comment has been minimized.

@toastdriven

toastdriven Mar 13, 2013

Contributor

Does this need updating anywhere else? If not (& if this will be using self.message in the future), is there any value in keeping it?

@toastdriven

toastdriven Mar 13, 2013

Contributor

Does this need updating anywhere else? If not (& if this will be using self.message in the future), is there any value in keeping it?

@toastdriven

This comment has been minimized.

Show comment
Hide comment
@toastdriven

toastdriven Mar 13, 2013

Contributor

By & large, this looks fine to me outside of that one bit of feedback.

Contributor

toastdriven commented Mar 13, 2013

By & large, this looks fine to me outside of that one bit of feedback.

@ghost ghost assigned toastdriven Jul 16, 2013

@toastdriven

This comment has been minimized.

Show comment
Hide comment
@toastdriven

toastdriven Jul 23, 2013

Contributor

Merged in SHA: b944f4b

Contributor

toastdriven commented Jul 23, 2013

Merged in SHA: b944f4b

@toastdriven toastdriven removed their assignment Mar 31, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment