The KeyError exception raised while generating a WSGI response based on
the 413 exception. Because there may be no "Retry-After" attribute in the
exception headers.
Change-Id: I89eb1878acc2195775be17fbcba8088f2e00bac1
Closes-Bug: #
1259867
'message': gettextutils.get_localized_message(explanation,
locale)}}
if code == 413:
- retry = self.wrapped_exc.headers['Retry-After']
- fault_data[fault_name]['retryAfter'] = retry
+ retry = self.wrapped_exc.headers.get('Retry-After', None)
+ if retry:
+ fault_data[fault_name]['retryAfter'] = retry
# 'code' is an attribute on the fault tag itself
metadata = {'attributes': {fault_name: 'code'}}