add error logging on caught exception to mailer
Merge branch 'develop' into postgres