Skip to content

Commit

Permalink
feat: added Exception to InitAsync OpenSearch
Browse files Browse the repository at this point in the history
Refs: SITKO-CORE-T-19
  • Loading branch information
IgorAlymov committed Jul 26, 2024
1 parent b3f6ee7 commit 637b1c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Sitko.Core.Search.OpenSearch/OpenSearchSearcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.Extensions.Options;
using OpenSearch.Client;
using OpenSearch.Net;
using Exception = System.Exception;

namespace Sitko.Core.Search.OpenSearch;

Expand Down Expand Up @@ -151,6 +152,7 @@ public async Task InitAsync(string indexName, CancellationToken cancellationToke
{
logger.LogError("Error while init {IndexName} index: {ErrorText}", indexName,
result.ServerError);
throw new Exception("Error while init " + indexName + " index: " + result.ServerError);
}

if (result.OriginalException != null)
Expand All @@ -170,6 +172,7 @@ public async Task InitAsync(string indexName, CancellationToken cancellationToke
{
logger.LogError("Error while create {IndexName} index: {ErrorText}", indexName,
result.ServerError);
throw new Exception("Error while init " + indexName + " index: " + result.ServerError);
}

if (result.OriginalException != null)
Expand Down

0 comments on commit 637b1c3

Please sign in to comment.