1616using Azure . Search . Documents . Models ;
1717using Microsoft . Extensions . Logging ;
1818using Microsoft . KernelMemory . AI ;
19- using Microsoft . KernelMemory . Configuration ;
2019using Microsoft . KernelMemory . ContentStorage ;
2120using Microsoft . KernelMemory . Diagnostics ;
2221using Microsoft . KernelMemory . MemoryStorage ;
@@ -53,12 +52,12 @@ public AzureAISearchMemory(
5352 if ( string . IsNullOrEmpty ( config . Endpoint ) )
5453 {
5554 this . _log . LogCritical ( "Azure AI Search Endpoint is empty" ) ;
56- throw new ConfigurationException ( "Azure AI Search Endpoint is empty" ) ;
55+ throw new ConfigurationException ( $ "Azure AI Search: { nameof ( config . Endpoint ) } is empty") ;
5756 }
5857
5958 if ( this . _embeddingGenerator == null )
6059 {
61- throw new AzureAISearchMemoryException ( "Embedding generator not configured") ;
60+ throw new ConfigurationException ( $ "Azure AI Search: { nameof ( this . _embeddingGenerator ) } is not configured") ;
6261 }
6362
6463 switch ( config . Auth )
@@ -74,7 +73,7 @@ public AzureAISearchMemory(
7473 if ( string . IsNullOrEmpty ( config . APIKey ) )
7574 {
7675 this . _log . LogCritical ( "Azure AI Search API key is empty" ) ;
77- throw new ConfigurationException ( "Azure AI Search API key is empty" ) ;
76+ throw new ConfigurationException ( $ "Azure AI Search: { nameof ( config . APIKey ) } is empty") ;
7877 }
7978
8079 this . _adminClient = new SearchIndexClient (
@@ -431,10 +430,7 @@ private static SearchClientOptions GetClientOptions()
431430 /// <returns>Normalized name</returns>
432431 private string NormalizeIndexName ( string index )
433432 {
434- if ( string . IsNullOrWhiteSpace ( index ) )
435- {
436- throw new ArgumentNullException ( nameof ( index ) , "The index name is empty" ) ;
437- }
433+ ArgumentNullExceptionEx . ThrowIfNullOrWhiteSpace ( index , nameof ( index ) , "The index name is empty" ) ;
438434
439435 if ( index . Length > 128 )
440436 {
0 commit comments