Instead of registering error message using the logging module before
raising the corresponding Exception, we use the Exception to provide
user-level error messages (and use logging.debug or logging.error to
store dev-level error messages before).
The main routine catches those exceptions and forwards the messages
to the logging module.