More details for error

I am working on tool that generates Open Xml (docx) files. I have problem to open these files in Libre Office. The only information that I receive from Libre Office is “General Error” “General input/output Error”. Note the same files can be opened with MS Office without any issues.

How I can get more details about what exactly is happening. Is there an option to enable better error reporting (call stacks) or something.