Improved error handling in enterprise environment service.

This commit is contained in:
Thorsten Sommer 2026-01-24 20:15:16 +01:00
parent 127778df42
commit fef0f7d248
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 37 additions and 6 deletions

View File

@ -34,16 +34,46 @@ public sealed class EnterpriseEnvironmentService(ILogger<EnterpriseEnvironmentSe
{
logger.LogInformation("Start updating of the enterprise environment.");
var enterpriseRemoveConfigId = await rustService.EnterpriseEnvRemoveConfigId();
Guid enterpriseRemoveConfigId;
try
{
enterpriseRemoveConfigId = await rustService.EnterpriseEnvRemoveConfigId();
}
catch (Exception e)
{
logger.LogError(e, "Failed to fetch the enterprise remove configuration ID from the Rust service.");
return;
}
var isPlugin2RemoveInUse = PluginFactory.AvailablePlugins.Any(plugin => plugin.Id == enterpriseRemoveConfigId);
if (enterpriseRemoveConfigId != Guid.Empty && isPlugin2RemoveInUse)
{
logger.LogWarning($"The enterprise environment configuration ID '{enterpriseRemoveConfigId}' must be removed.");
PluginFactory.RemovePluginAsync(enterpriseRemoveConfigId);
}
var enterpriseConfigServerUrl = await rustService.EnterpriseEnvConfigServerUrl();
var enterpriseConfigId = await rustService.EnterpriseEnvConfigId();
string? enterpriseConfigServerUrl;
try
{
enterpriseConfigServerUrl = await rustService.EnterpriseEnvConfigServerUrl();
}
catch (Exception e)
{
logger.LogError(e, "Failed to fetch the enterprise configuration server URL from the Rust service.");
return;
}
Guid enterpriseConfigId;
try
{
enterpriseConfigId = await rustService.EnterpriseEnvConfigId();
}
catch (Exception e)
{
logger.LogError(e, "Failed to fetch the enterprise configuration ID from the Rust service.");
return;
}
var etag = await PluginFactory.DetermineConfigPluginETagAsync(enterpriseConfigId, enterpriseConfigServerUrl);
var nextEnterpriseEnvironment = new EnterpriseEnvironment(enterpriseConfigServerUrl, enterpriseConfigId, etag);
if (CURRENT_ENVIRONMENT != nextEnterpriseEnvironment)

View File

@ -3,12 +3,13 @@
- Added the current date and time to the system prompt for better context in conversations. Thanks Peer `peerschuett` for the contribution.
- Added the ability to control the voice recording with transcription (in preview) by using a system-wide shortcut. The shortcut can be configured in the application settings or by using a configuration plugin. Thus, a uniform shortcut can be defined for an entire organization.
- Added error handling for the context window overflow, which can occur with huge file attachments in chats or the document analysis assistant.
- Improved error handling for model loading in provider dialogs (LLMs, embeddings, transcriptions).
- Improved the error handling for model loading in provider dialogs (LLMs, embeddings, transcriptions).
- Improved the microphone handling (transcription preview) so that all sound effects and the voice recording are processed without interruption.
- Improved the handling of self-hosted providers in the configuration dialogs (LLMs, embeddings, and transcriptions) when the host cannot provide a list of models.
- Improved the document analysis assistant (in preview) by allowing users to send results to a new chat to ask follow-up questions. Thanks to Sabrina `Sabrina-devops` for this contribution.
- Improved the developer experience by detecting incorrect CPU architecture metadata when checking and installing the Pandoc dependency.
- Improved error messages for failed communication with AI servers.
- Improved the error messages for failed communication with AI servers.
- Improved the error handling for the enterprise environment service regarding the communication with our Rust layer.
- Fixed a logging bug that prevented log events from being recorded in some cases.
- Fixed a bug that allowed adding a provider (LLM, embedding, or transcription) without selecting a model.
- Fixed a bug with local transcription providers by handling errors correctly when the local provider is unavailable.