Add caught exception to the logs

This should help later to determine the cause of the exception.

See http://sentry.oucs.ox.ac.uk/weblearn-live/group/5252/