Error handling when failing to attach pdf to email