auto_backup icon indicating copy to clipboard operation
auto_backup copied to clipboard

pysftp: verbose exception (enum dependency)

Open dek-odoo opened this issue 5 years ago • 3 comments

The pysftp depends on enum, so when enum is not installed, we will see error pysftp is needed instead of the actual error of missing enum.

I got it couple of times.

So may be we can update and show the actual exception message: https://github.com/Yenthe666/auto_backup/blob/10.0/auto_backup/models/db_backup.py#L38

may be something like:

except ImportError as ie:
    raise ImportError('pysftp not installed, please.....'+str(ie))

Thanks for the nice module !! :+1:

dek-odoo avatar Apr 29 '19 10:04 dek-odoo

Hmm maybe I can just add the str(ie) at the end of the sentence though? Like "This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)'). Traceback: %s" % str(ie)?

Yenthe666 avatar Apr 30 '19 08:04 Yenthe666

Yeah, Or we can also be more explicit and let user know like "Failed to import pysftp, This module needs pysftp to.... " and then str(ie) :+1:

dek-odoo avatar May 02 '19 11:05 dek-odoo

@dek-odoo , are you saying that there is a way of installing pysftp without having its dependency enum also installed? Or am I misreading something here?

gaikaz avatar May 02 '19 11:05 gaikaz