Source

gett-cli / gett_uploader.py

Diff from to

File gett_uploader.py

     try:
         main()
     except APIError as ex:
-        print('API error: %s' % ex)
+        logger.error('API error: %s', ex)
 
 def pattern(string):
     import glob
                 ret.append(open(item, 'rb'))
 
     if not ret:
-        print('warning: %s: no match' % string)
+        logger.warning('%s: no match', string)
     return ret
 
 def main():
 
         try:
             user.login_auth(args.email, args.password)
-        except Exception as ex:
-            print('Unable to login: %s' % ex.args[0])
+        except APIError as ex:
+            logger.error('Unable to login: %s', ex)
             sys.exit(1)
 
         reply = input('Do you wish to store the session token? (y/n): ')