Index: build/android/device_status_check.py |
diff --git a/build/android/device_status_check.py b/build/android/device_status_check.py |
index 851fd94978bf80758a97aa83da1c05c6426200a8..50d8e8b24ba6aae01e912fcba49d4a4d01b77e29 100755 |
--- a/build/android/device_status_check.py |
+++ b/build/android/device_status_check.py |
@@ -116,9 +116,12 @@ def CheckForMissingDevices(options, adb_online_devs): |
'To: %s' % to_address, |
'Subject: %s' % subject, |
'', body]) |
- server = smtplib.SMTP('localhost') |
- server.sendmail(from_address, [to_address], msg_body) |
- server.quit() |
+ try: |
+ server = smtplib.SMTP('localhost') |
+ server.sendmail(from_address, [to_address], msg_body) |
+ server.quit() |
+ except Exception as e: |
+ print 'Failed to send alert email. Error: %s' % e |
else: |
new_devs = set(adb_online_devs) - set(last_devices) |
if new_devs and os.path.exists(last_devices_path): |