parent
12be55fec2
commit
3bb5f3be3b
@ -46,8 +46,8 @@ def bitwarden_to_keepass(args):
|
||||
bw_item = Item(item)
|
||||
|
||||
is_duplicate_title = False
|
||||
try:
|
||||
while True:
|
||||
entry = None
|
||||
entry_title = bw_item.get_name() if not is_duplicate_title else '{name} - ({item_id}'.format(name=bw_item.get_name(), item_id=bw_item.get_id())
|
||||
try:
|
||||
entry = kp.add_entry(
|
||||
@ -62,12 +62,7 @@ def bitwarden_to_keepass(args):
|
||||
if 'already exists' in str(e):
|
||||
is_duplicate_title = True
|
||||
continue
|
||||
|
||||
logging.warning(f'Skipping item named "{item["name"]}" because of this error: {repr(e)}')
|
||||
break
|
||||
|
||||
if not entry:
|
||||
continue
|
||||
raise
|
||||
|
||||
totp_secret, totp_settings = bw_item.get_totp()
|
||||
if totp_secret and totp_settings:
|
||||
@ -91,6 +86,10 @@ def bitwarden_to_keepass(args):
|
||||
entry.add_attachment(attachment_id, attachment['fileName'])
|
||||
os.remove(attachment_path)
|
||||
|
||||
except Exception as e:
|
||||
logging.warning(f'Skipping item named "{item["name"]}" because of this error: {repr(e)}')
|
||||
continue
|
||||
|
||||
logging.info('Saving changes to KeePass database.')
|
||||
kp.save()
|
||||
logging.info('Export completed.')
|
||||
|
Loading…
x
Reference in New Issue
Block a user