File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/Database/Repositories/Couchbase Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -85,9 +85,17 @@ public async Task IncrementRetryCountAsync(IEnumerable<long> ids)
8585
8686 await Task . WhenAll ( tasks ) ;
8787
88- foreach ( var task in tasks . Where ( task => task . Result . MetaData ! . Status != QueryStatus . Success ) )
88+ ThrowExceptionsForFailedQueries ( tasks ) ;
89+ }
90+
91+ private static void ThrowExceptionsForFailedQueries ( List < Task < IQueryResult < dynamic > > > tasks )
92+ {
93+ var failedTasks = tasks . Where ( task => task . Result . MetaData ! . Status != QueryStatus . Success ) . ToList ( ) ;
94+ if ( failedTasks . Count > 0 )
8995 {
90- throw new CouchbaseQueryFailedException ( task . Result . Errors . ToString ( ) ) ;
96+ var errors = failedTasks . Select ( task => task . Result . Errors . ToString ( ) ) . ToList ( ) ;
97+ var joinedErrors = string . Join ( " | " , errors ) ;
98+ throw new CouchbaseQueryFailedException ( joinedErrors ) ;
9199 }
92100 }
93101
You can’t perform that action at this time.
0 commit comments