Add logging to study processing

Tiny change but useful for debugging.
Once we go live it will use the basehandler error function to deal with this, but it will need to render a different page since right now it gives full traceback info for debugging purposes.