mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
Updated logging as logger was parsing some JSON and erroring.
- Don't write whole JSON response. Safer not to anyway. No need.
This commit is contained in:
@@ -68,12 +68,11 @@ class FiretextClient(SmsClient):
|
||||
return self.name
|
||||
|
||||
def record_outcome(self, success, response):
|
||||
log_message = "API {} request {} on {} response status_code {} response text'{}'".format(
|
||||
log_message = "API {} request {} on {} response status_code {}".format(
|
||||
"POST",
|
||||
"succeeded" if success else "failed",
|
||||
self.url,
|
||||
response.status_code,
|
||||
response.text
|
||||
response.status_code
|
||||
)
|
||||
|
||||
if not success:
|
||||
@@ -83,13 +82,6 @@ class FiretextClient(SmsClient):
|
||||
self.current_app.logger.info(log_message)
|
||||
self.statsd_client.incr("clients.firetext.success")
|
||||
|
||||
@staticmethod
|
||||
def check_response(response):
|
||||
response.raise_for_status()
|
||||
json.loads(response.text)
|
||||
if response.json()['code'] != 0:
|
||||
raise ValueError()
|
||||
|
||||
def send_sms(self, to, content, reference, sender=None):
|
||||
|
||||
data = {
|
||||
|
||||
@@ -68,12 +68,11 @@ class MMGClient(SmsClient):
|
||||
self.mmg_url = current_app.config.get('MMG_URL')
|
||||
|
||||
def record_outcome(self, success, response):
|
||||
log_message = "API {} request {} on {} response status_code {} response text'{}'".format(
|
||||
log_message = "API {} request {} on {} response status_code {}".format(
|
||||
"POST",
|
||||
"succeeded" if success else "failed",
|
||||
self.mmg_url,
|
||||
response.status_code,
|
||||
response.text
|
||||
response.status_code
|
||||
)
|
||||
|
||||
if not success:
|
||||
|
||||
Reference in New Issue
Block a user