Skip to content

Commit

Permalink
added more output for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mdunne committed Aug 3, 2017
1 parent ee0a130 commit 5710c1a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions adbacli.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
connection.auth(args.username, args.password)
except Exception as e:
print('Exception: %s', e)
logging.debug('Exception Occured: '+str(e))

# Execute command
if args.command == 'hash':
Expand All @@ -129,16 +130,19 @@
episode = adba.Episode(connection, filePath=thisFile)
except Exception as e:
print('Exception: %s', e)
logging.debug('Exception Occured: '+str(e))
continue
try:
episode.edit_to_mylist(state=args.state, viewed=viewed, source=args.source, storage=args.storage, other=args.other)
print(thisFile + " successfully edited in AniDB MyList.")
except:
except Exception as e:
logging.debug('Exception Occured: '+str(e))
try:
episode.add_to_mylist(state=args.state, viewed=viewed, source=args.source, storage=args.storage, other=args.other)
print(thisFile + " successfully added to AniDB MyList.")
except Exception as e:
print('Exception: %s', e)
logging.debug('Exception Occured: '+str(e))
continue
elif args.command == 'mylistdel':
# Delete the file
Expand All @@ -148,12 +152,14 @@
episode = adba.Episode(connection, filePath=thisFile)
except Exception as e:
print('Exception: %s', e)
logging.debug('Exception Occured: '+str(e))
continue
try:
episode.delete_from_mylist()
print(thisFile + " successfully removed from AniDB MyList.")
except Exception as e:
print('Exception: %s', e)
logging.debug('Exception Occured: '+str(e))
continue
elif args.command == 'mylistaddwithfields':
# Parse requested field(s)
Expand All @@ -171,16 +177,19 @@
episode = adba.Episode(connection, filePath=thisFile, load=True, paramsF=requestF, paramsA=requestA)
except Exception as e:
print('Exception: %s', e)
logging.debug('Exception Occured: '+str(e))
continue
try:
episode.edit_to_mylist(state=args.state, viewed=viewed, source=args.source, storage=args.storage, other=args.other)
print(thisFile + " successfully edited in AniDB MyList.")
except:
except Exception as e:
logging.debug('Exception Occured: '+str(e))
try:
episode.add_to_mylist(state=args.state, viewed=viewed, source=args.source, storage=args.storage, other=args.other)
print(thisFile + " successfully added to AniDB MyList.")
except Exception as e:
print('Exception: %s', e)
logging.debug('Exception Occured: '+str(e))
continue
print("filename\t" + thisFile)
for field in requestedFields:
Expand All @@ -202,6 +211,7 @@
episode = adba.Episode(connection, filePath=thisFile, load=True, paramsF=requestF, paramsA=requestA)
except Exception as e:
print('Exception: %s', e)
logging.debug('Exception Occured: '+str(e))
continue
print("filename\t" + thisFile)
for field in requestedFields:
Expand Down

0 comments on commit 5710c1a

Please sign in to comment.