@@ -111,6 +111,8 @@ func (s *SearchIndexAdminServer) CreateIndex(ctx context.Context, in *admin_sear
111111 return nil , s .errorHandler .NewIncorrectSearchSourceTypeStatus (err , in .Name , in .SourceType ).Err ()
112112 } else if errors .Is (err , cbsearchx .ErrSourceNotFound ) {
113113 return nil , s .errorHandler .NewSearchSourceNotFoundStatus (err , in .Name , in .SourceName ).Err ()
114+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
115+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
114116 }
115117 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
116118 }
@@ -217,6 +219,8 @@ func (s *SearchIndexAdminServer) UpdateIndex(ctx context.Context, in *admin_sear
217219 return nil , s .errorHandler .NewIncorrectSearchSourceTypeStatus (err , in .Index .Name , in .Index .SourceType ).Err ()
218220 } else if errors .Is (err , cbsearchx .ErrSourceNotFound ) {
219221 return nil , s .errorHandler .NewSearchSourceNotFoundStatus (err , in .Index .Name , in .Index .SourceName ).Err ()
222+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
223+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
220224 }
221225 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
222226 }
@@ -264,6 +268,8 @@ func (s *SearchIndexAdminServer) DeleteIndex(ctx context.Context, in *admin_sear
264268 return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
265269 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
266270 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
271+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
272+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
267273 }
268274 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
269275 }
@@ -311,6 +317,8 @@ func (s *SearchIndexAdminServer) GetIndex(ctx context.Context, in *admin_search_
311317 return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
312318 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
313319 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
320+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
321+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
314322 }
315323 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
316324 }
@@ -346,6 +354,8 @@ func (s *SearchIndexAdminServer) ListIndexes(ctx context.Context, in *admin_sear
346354 return nil , s .errorHandler .NewSearchServiceNotAvailableStatus (err , "" ).Err ()
347355 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
348356 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , "" ).Err ()
357+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
358+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
349359 }
350360 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
351361 }
@@ -393,6 +403,8 @@ func (s *SearchIndexAdminServer) AnalyzeDocument(ctx context.Context, in *admin_
393403 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
394404 } else if errors .Is (err , cbsearchx .ErrNoIndexPartitionsFound ) {
395405 return nil , s .errorHandler .NewSearchIndexNotReadyStatus (err , in .Name ).Err ()
406+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
407+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
396408 }
397409 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
398410 }
@@ -432,6 +444,8 @@ func (s *SearchIndexAdminServer) GetIndexedDocumentsCount(ctx context.Context, i
432444 return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
433445 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
434446 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
447+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
448+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
435449 }
436450 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
437451 }
@@ -470,6 +484,8 @@ func (s *SearchIndexAdminServer) PauseIndexIngest(ctx context.Context, in *admin
470484 return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
471485 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
472486 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
487+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
488+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
473489 }
474490 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
475491 }
@@ -506,6 +522,8 @@ func (s *SearchIndexAdminServer) ResumeIndexIngest(ctx context.Context, in *admi
506522 return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
507523 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
508524 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
525+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
526+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
509527 }
510528 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
511529 }
@@ -542,6 +560,8 @@ func (s *SearchIndexAdminServer) AllowIndexQuerying(ctx context.Context, in *adm
542560 return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
543561 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
544562 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
563+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
564+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
545565 }
546566 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
547567 }
@@ -578,6 +598,8 @@ func (s *SearchIndexAdminServer) DisallowIndexQuerying(ctx context.Context, in *
578598 return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
579599 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
580600 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
601+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
602+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
581603 }
582604 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
583605 }
@@ -614,6 +636,8 @@ func (s *SearchIndexAdminServer) FreezeIndexPlan(ctx context.Context, in *admin_
614636 return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
615637 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
616638 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
639+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
640+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
617641 }
618642 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
619643 }
@@ -650,6 +674,8 @@ func (s *SearchIndexAdminServer) UnfreezeIndexPlan(ctx context.Context, in *admi
650674 return nil , s .errorHandler .NewSearchIndexNameEmptyStatus (err ).Err ()
651675 } else if errors .Is (err , cbsearchx .ErrOnlyBucketOrScopeSet ) {
652676 return nil , s .errorHandler .NewOnlyBucketOrScopeSetStatus (err , in .Name ).Err ()
677+ } else if errors .Is (err , cbsearchx .ErrAuthenticationFailure ) {
678+ return nil , s .errorHandler .NewSearchIndexAuthenticationFailureStatus (err , in .BucketName , in .ScopeName ).Err ()
653679 }
654680 return nil , s .errorHandler .NewGenericStatus (err ).Err ()
655681 }
0 commit comments