Broadened exception handling for pypandoc.