Catch TypeError thrown when password incorrectly formatted

This commit is contained in:
moyamo 2015-06-21 15:09:56 +02:00
parent 83f499b81d
commit 0ecc89d270
2 changed files with 7 additions and 3 deletions

View file

@ -121,8 +121,12 @@ class Session():
YowConstants.DOMAIN) YowConstants.DOMAIN)
self.stack.setProp(YowCoderLayer.PROP_RESOURCE, self.stack.setProp(YowCoderLayer.PROP_RESOURCE,
env.CURRENT_ENV.getResource()) env.CURRENT_ENV.getResource())
try:
self.stack.broadcastEvent( self.stack.broadcastEvent(
YowLayerEvent(YowNetworkLayer.EVENT_STATE_CONNECT)) YowLayerEvent(YowNetworkLayer.EVENT_STATE_CONNECT))
except TypeError as e: # Occurs when password is not correctly formated
self.logger.debug("Auth error -> user: %s; details: %s;",
self.user, e)
try: try:
self.stack.loop() self.stack.loop()
except AuthError as e: # For some reason Yowsup throws an exception except AuthError as e: # For some reason Yowsup throws an exception

View file

@ -51,7 +51,7 @@ parser.add_argument('-j', type=str, required=True)
args, unknown = parser.parse_known_args() args, unknown = parser.parse_known_args()
YowConstatns.PATH_STORAGE='/var/lib/spectrum/' + args.j YowConstants.PATH_STORAGE='/var/lib/spectrum2/' + args.j
# Logging # Logging
logging.basicConfig( \ logging.basicConfig( \
format = "%(asctime)-15s %(levelname)s %(name)s: %(message)s", \ format = "%(asctime)-15s %(levelname)s %(name)s: %(message)s", \