Error handling
Leave feedback
On this page
All Convert() methods throw on failure. Use standard try/catch with specific exception types:
using GroupDocs.Markdown;
try
{
MarkdownConverter.ToFile("annual-report.docx", "error-handling-example.md");
}
catch (DocumentProtectedException)
{
Console.WriteLine("Wrong or missing password.");
}
catch (InvalidFormatException)
{
Console.WriteLine("File is corrupt or unsupported.");
}
catch (GroupDocsMarkdownException ex)
{
Console.WriteLine($"Conversion failed: {ex.Message}");
}
annual-report.docx is a sample file used in this example. Click here to download it.
;
ConvertResult result = converter.Convert("warnings-example.md", new ConvertOptions { MaxRows = 10 });
foreach (string warning in result.Warnings)
Console.WriteLine($"Warning: {warning}");
cost-analysis.xlsx is a sample file used in this example. Click here to download it.
## Summary
| Category | FY2024 | FY2025 | FY2026 |
| --- | --- | --- | --- |
| Parts and materials | $1,325,000.00 | $1,480,000.00 | $1,620,000.00 |
| Manufacturing equipment | $900,500.00 | $980,000.00 | $1,050,000.00 |
| Warehousing | $420,000.00 | $510,000.00 | $590,000.00 |
| Shipping | $380,000.00 | $445,000.00 | $520,000.00 |
| Marketing | $250,000.00 | $340,000.00 | $480,000.00 |
| R&D | $180,000.00 | $230,000.00 | $310,000.00 |
[TRUNCATED]
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.