mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-15 18:01:36 +00:00
Improve error handling in Microsoft Word export
This commit is contained in:
parent
f521c11a60
commit
88c1e3d434
@ -80,11 +80,18 @@ public static class PandocExport
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Read output streams asynchronously while the process runs (prevents deadlock):
|
||||||
|
var outputTask = process.StandardOutput.ReadToEndAsync();
|
||||||
|
var errorTask = process.StandardError.ReadToEndAsync();
|
||||||
|
|
||||||
|
// Wait for the process to exit AND for streams to be fully read:
|
||||||
await process.WaitForExitAsync();
|
await process.WaitForExitAsync();
|
||||||
|
await outputTask;
|
||||||
|
var error = await errorTask;
|
||||||
|
|
||||||
if (process.ExitCode is not 0)
|
if (process.ExitCode is not 0)
|
||||||
{
|
{
|
||||||
var error = await process.StandardError.ReadToEndAsync();
|
LOGGER.LogError("Pandoc failed with exit code {ProcessExitCode}: '{ErrorText}'", process.ExitCode, error);
|
||||||
LOGGER.LogError($"Pandoc failed with exit code {process.ExitCode}: {error}");
|
|
||||||
await MessageBus.INSTANCE.SendError(new(Icons.Material.Filled.Cancel, TB("Error during Microsoft Word export")));
|
await MessageBus.INSTANCE.SendError(new(Icons.Material.Filled.Cancel, TB("Error during Microsoft Word export")));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,4 +6,6 @@
|
|||||||
- Improved the document preview dialog for the document analysis assistant (in preview), providing Markdown and plain text views for attached files.
|
- Improved the document preview dialog for the document analysis assistant (in preview), providing Markdown and plain text views for attached files.
|
||||||
- Improved the ID handling for configuration plugins.
|
- Improved the ID handling for configuration plugins.
|
||||||
- Improved error handling, logging, and code quality.
|
- Improved error handling, logging, and code quality.
|
||||||
|
- Improved error handling for Microsoft Word export.
|
||||||
- Fixed a bug in the local data sources info dialog (preview feature) for data directories that could cause the app to crash. The error was caused by a background thread producing data while the frontend attempted to display it.
|
- Fixed a bug in the local data sources info dialog (preview feature) for data directories that could cause the app to crash. The error was caused by a background thread producing data while the frontend attempted to display it.
|
||||||
|
- Fixed a rare bug in the Microsoft Word export for huge documents.
|
||||||
Loading…
Reference in New Issue
Block a user