scailable / sclblpy

Python package for Scailable uploads
MIT License
19 stars 1 forks source link

Do not raise errors, rather print a pretty message (and perhaps log errors) #12

Closed MKaptein closed 4 years ago

MKaptein commented 4 years ago

Currently, in various places, the sclblpy package raises its own errors. We should replace these by informative print statements such that the stack-tracke is not printed (perhaps unless a global degub is set to true...)

Also, check, if not raising an exception, wether the code continues.

MKaptein commented 4 years ago

So, effectively we now have two "settings" which can be toggled programmatically.

start_print()  # restores printing
stop_print()  # stops all printing

and we have:

_toggle_debug_mode()  # toggle debug.

If printing is turned on (default), the package will print user feedback. If printing is stopped the package will not print any feedback. If in debug mode the package will print more elaborate feedback, and will raise exceptions if they occur (including the stack trace).