All Convert() methods throw on failure. Use standard try/catch with specific exception types:
usingGroupDocs.Markdown;try{stringmd=MarkdownConverter.ToMarkdown("file.docx");Console.WriteLine(md);}catch(DocumentProtectedException){Console.WriteLine("Wrong or missing password.");}catch(InvalidFormatException){Console.WriteLine("File is corrupt or unsupported.");}catch(GroupDocsMarkdownExceptionex){Console.WriteLine($"Conversion failed: {ex.Message}");}
Exception types
Exception
When thrown
DocumentProtectedException
Document is password-protected and no password or wrong password was provided
InvalidFormatException
File is corrupt or has an unrecognized format
GroupDocsMarkdownException
General conversion error
Conversion warnings
Non-fatal issues are reported via ConvertResult.Warnings: