Improve handling of subscription exceptions
@@ -57,15 +57,14 @@ class SignupFormWithNewsletter(SignupForm):
headers=headers,
timeout=3, # seconds
)
+ resp.raise_for_status()
except requests.Timeout:
log.warning(
'Timeout subscribing user to newsletter. email=%s, user=%s',
self.cleaned_data["email"],
user.username,
)
-
- else:
- if not resp.ok:
+ except Exception: # noqa
log.exception(
'Unknown error subscribing user to newsletter. email=%s, user=%s',
self.cleaned_data["email"],
