Commit d84d4b7e authored by Johan Ström's avatar Johan Ström

python3 does not have Exception.message

parent e125eb35
......@@ -133,7 +133,7 @@ class Alert(threading.Thread):
except Exception as e:
self.log.exception('Error testing alert:')
error = 1
msg = str(e.message)
msg = str(e)
if len(msg)==0:
if getattr(e, 'reason', None):
msg = str(e.reason)
......@@ -730,7 +730,7 @@ class Pushover(Alert):
return True, 'Message pushed successfully'
except:
self.log.exception('Pushover: Exception push message')
return False, str(e.message)
return False, 'Unhandled exception'
class Pushsafer(Alert):
"""
......@@ -816,7 +816,7 @@ class Pushsafer(Alert):
return True, 'Message pushed successfully'
except:
self.log.exception('Pushsafer: Exception push message')
return False, str(e.message)
return False, 'Pushsafer: Unhandled exception'
class Pushbullet(Alert):
"""
......@@ -1052,7 +1052,7 @@ class Notifymyandroid(Alert):
return False, 'error code %s' % code
except:
self.log.exception('Notifymyandroid: Exception push message')
return False, str(e.message)
return False, 'Notifymyandroid: Unhandled exception'
......
......@@ -194,7 +194,7 @@ class PullStatus(threading.Thread):
else:
self.log.error('PullStatus: Could not get status from light')
except TypeError as e:
self.log.error("PullStatus: Exception occurred in background thread. {}".format(e.message))
self.log.error("PullStatus: Exception occurred in background thread. {}".format(str(e)))
time.sleep(float(self.PollDelay)) # TODO: Calculate ((60-n)/NoDevices)/60
if __name__ == "__main__":
......
......@@ -313,10 +313,10 @@ class AgoApp:
except ConfigurationError as e:
if self.log:
self.log.error("Failed to start %s due to configuration error: %s",
self.app_name, e.message)
self.app_name, e)
else:
# Print to stderr, in case logging setup failed
print("Failed to start %s due to configuration error: %s" % (self.app_name, e.message),
print("Failed to start %s due to configuration error: %s" % (self.app_name, e),
file=sys.stderr)
return 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment