Changed to functional error handling to facilitate

moving lines of code out of "render".
This will need review to ensure that tracebacks are properly handled.
Pass error info with exception to outer hanlder.