Improve exception handling in PyPortal code
Improve exception handling in PyPortal code

Also fix / workaround pylint warnings.

terop/env-logger,terop/env-logger,terop/env-logger,terop/env-logger,terop/env-logger,terop/env-logger,terop/env-logger