@@ -863,7 +863,6 @@ public void close() {
863863 * empty.
864864 * @throws TableServiceException If no {@link TableEntity entity} with the provided {@code partitionKey} and
865865 * {@code rowKey} exists within the table.
866- * table.
867866 */
868867 @ ServiceMethod (returns = ReturnType .SINGLE )
869868 public Mono <TableEntity > getEntity (String partitionKey , String rowKey ) {
@@ -939,12 +938,16 @@ <T extends TableEntity> Mono<Response<T>> getEntityWithResponse(String partition
939938 * Retrieves details about any stored {@link TableAccessPolicies access policies} specified on the table that may
940939 * be used with Shared Access Signatures.
941940 *
941+ * <p>This operation is only supported on Azure Storage endpoints.</p>
942+ *
942943 * <p><strong>Code Samples</strong></p>
943944 * <p>Gets a table's {@link TableAccessPolicies access policies}. Prints out the details of the retrieved
944945 * {@link TableAccessPolicies access policies}.</p>
945946 * {@codesnippet com.azure.data.tables.tableAsyncClient.getAccessPolicies}
946947 *
947948 * @return A {@link Mono} containing the table's {@link TableAccessPolicies access policies}.
949+ *
950+ * @throws TableServiceException If the request is rejected by the service.
948951 */
949952 @ ServiceMethod (returns = ReturnType .SINGLE )
950953 public Mono <TableAccessPolicies > getAccessPolicies () {
@@ -956,13 +959,17 @@ public Mono<TableAccessPolicies> getAccessPolicies() {
956959 * Retrieves details about any stored {@link TableAccessPolicies access policies} specified on the table that may be
957960 * used with Shared Access Signatures.
958961 *
962+ * <p>This operation is only supported on Azure Storage endpoints.</p>
963+ *
959964 * <p><strong>Code Samples</strong></p>
960965 * <p>Gets a table's {@link TableAccessPolicies access policies}. Prints out the details of the
961966 * {@link Response HTTP response} and the retrieved {@link TableAccessPolicies access policies}.</p>
962967 * {@codesnippet com.azure.data.tables.tableAsyncClient.getAccessPoliciesWithResponse}
963968 *
964969 * @return A {@link Mono} containing an {@link Response HTTP response} that in turn contains the table's
965970 * {@link TableAccessPolicies access policies}.
971+ *
972+ * @throws TableServiceException If the request is rejected by the service.
966973 */
967974 @ ServiceMethod (returns = ReturnType .SINGLE )
968975 public Mono <Response <TableAccessPolicies >> getAccessPoliciesWithResponse () {
@@ -975,6 +982,7 @@ Mono<Response<TableAccessPolicies>> getAccessPoliciesWithResponse(Context contex
975982 try {
976983 return tablesImplementation .getTables ()
977984 .getAccessPolicyWithResponseAsync (tableName , null , null , context )
985+ .onErrorMap (TableUtils ::mapThrowableToTableServiceException )
978986 .map (response -> new SimpleResponse <>(response ,
979987 new TableAccessPolicies (response .getValue () == null ? null : response .getValue ().stream ()
980988 .map (this ::toTableSignedIdentifier )
@@ -1008,13 +1016,17 @@ private TableAccessPolicy toTableAccessPolicy(AccessPolicy accessPolicy) {
10081016 * Sets stored {@link TableAccessPolicies access policies} for the table that may be used with Shared Access
10091017 * Signatures.
10101018 *
1019+ * <p>This operation is only supported on Azure Storage endpoints.</p>
1020+ *
10111021 * <p><strong>Code Samples</strong></p>
10121022 * <p>Sets stored {@link TableAccessPolicies access policies} on a table.</p>
10131023 * {@codesnippet com.azure.data.tables.tableAsyncClient.setAccessPolicies#List}
10141024 *
10151025 * @param tableSignedIdentifiers The {@link TableSignedIdentifier access policies} for the table.
10161026 *
10171027 * @return An empty {@link Mono}.
1028+ *
1029+ * @throws TableServiceException If the request is rejected by the service.
10181030 */
10191031 @ ServiceMethod (returns = ReturnType .SINGLE )
10201032 public Mono <Void > setAccessPolicies (List <TableSignedIdentifier > tableSignedIdentifiers ) {
@@ -1025,6 +1037,8 @@ public Mono<Void> setAccessPolicies(List<TableSignedIdentifier> tableSignedIdent
10251037 * Sets stored {@link TableAccessPolicies access policies} for the table that may be used with Shared Access
10261038 * Signatures.
10271039 *
1040+ * <p>This operation is only supported on Azure Storage endpoints.</p>
1041+ *
10281042 * <p><strong>Code Samples</strong></p>
10291043 * <p>Sets stored {@link TableAccessPolicies access policies} on a table. Prints out details of the
10301044 * {@link Response HTTP response}.</p>
@@ -1033,6 +1047,8 @@ public Mono<Void> setAccessPolicies(List<TableSignedIdentifier> tableSignedIdent
10331047 * @param tableSignedIdentifiers The {@link TableSignedIdentifier access policies} for the table.
10341048 *
10351049 * @return A {@link Mono} containing the {@link Response HTTP response}.
1050+ *
1051+ * @throws TableServiceException If the request is rejected by the service.
10361052 */
10371053 @ ServiceMethod (returns = ReturnType .SINGLE )
10381054 public Mono <Response <Void >> setAccessPoliciesWithResponse (List <TableSignedIdentifier > tableSignedIdentifiers ) {
@@ -1081,6 +1097,7 @@ OffsetDateTime.now will only give back milliseconds (more precise fields are zer
10811097 try {
10821098 return tablesImplementation .getTables ()
10831099 .setAccessPolicyWithResponseAsync (tableName , null , null , signedIdentifiers , context )
1100+ .onErrorMap (TableUtils ::mapThrowableToTableServiceException )
10841101 .map (response -> new SimpleResponse <>(response , response .getValue ()));
10851102 } catch (RuntimeException e ) {
10861103 return monoError (logger , e );
@@ -1132,6 +1149,7 @@ private AccessPolicy toAccessPolicy(TableAccessPolicy tableAccessPolicy) {
11321149 * correspond to each {@link TableTransactionAction action} in the transaction.
11331150 *
11341151 * @throws IllegalArgumentException If no {@link TableTransactionAction actions} have been added to the list.
1152+ * @throws TableServiceException If the request is rejected by the service.
11351153 * @throws TableTransactionFailedException If any {@link TableTransactionResult action} within the transaction
11361154 * fails. See the documentation for the client methods in {@link TableClient} to understand the conditions that
11371155 * may cause a given {@link TableTransactionAction action} to fail.
@@ -1168,6 +1186,7 @@ public Mono<TableTransactionResult> submitTransaction(List<TableTransactionActio
11681186 * correspond to each {@link TableTransactionAction action} in the transaction.
11691187 *
11701188 * @throws IllegalArgumentException If no {@link TableTransactionAction actions} have been added to the list.
1189+ * @throws TableServiceException If the request is rejected by the service.
11711190 * @throws TableTransactionFailedException If any {@link TableTransactionAction action} within the transaction
11721191 * fails. See the documentation for the client methods in {@link TableClient} to understand the conditions that
11731192 * may cause a given {@link TableTransactionAction action} to fail.
@@ -1180,8 +1199,8 @@ public Mono<Response<TableTransactionResult>> submitTransactionWithResponse(List
11801199 Mono <Response <TableTransactionResult >> submitTransactionWithResponse (List <TableTransactionAction > transactionActions , Context context ) {
11811200 Context finalContext = context == null ? Context .NONE : context ;
11821201
1183- if (transactionActions .size () == 0 ) {
1184- throw logger . logExceptionAsError (
1202+ if (transactionActions .isEmpty () ) {
1203+ return monoError ( logger ,
11851204 new IllegalArgumentException ("A transaction must contain at least one operation." ));
11861205 }
11871206
@@ -1224,18 +1243,23 @@ Mono<Response<TableTransactionResult>> submitTransactionWithResponse(List<TableT
12241243 }
12251244 }
12261245
1227- return Flux .fromIterable (operations )
1228- .flatMapSequential (op -> op .prepareRequest (transactionalBatchClient ).zipWith (Mono .just (op )))
1229- .collect (TransactionalBatchRequestBody ::new , (body , pair ) ->
1230- body .addChangeOperation (new TransactionalBatchSubRequest (pair .getT2 (), pair .getT1 ())))
1231- .publishOn (Schedulers .boundedElastic ())
1232- .flatMap (body ->
1233- transactionalBatchImplementation .submitTransactionalBatchWithRestResponseAsync (body , null ,
1234- finalContext ).zipWith (Mono .just (body )))
1235- .flatMap (pair -> parseResponse (pair .getT2 (), pair .getT1 ()))
1236- .map (response ->
1237- new SimpleResponse <>(response .getRequest (), response .getStatusCode (), response .getHeaders (),
1238- new TableTransactionResult (transactionActions , response .getValue ())));
1246+ try {
1247+ return Flux .fromIterable (operations )
1248+ .flatMapSequential (op -> op .prepareRequest (transactionalBatchClient ).zipWith (Mono .just (op )))
1249+ .collect (TransactionalBatchRequestBody ::new , (body , pair ) ->
1250+ body .addChangeOperation (new TransactionalBatchSubRequest (pair .getT2 (), pair .getT1 ())))
1251+ .publishOn (Schedulers .boundedElastic ())
1252+ .flatMap (body ->
1253+ transactionalBatchImplementation .submitTransactionalBatchWithRestResponseAsync (body , null ,
1254+ finalContext ).zipWith (Mono .just (body )))
1255+ .onErrorMap (TableUtils ::mapThrowableToTableServiceException )
1256+ .flatMap (pair -> parseResponse (pair .getT2 (), pair .getT1 ()))
1257+ .map (response ->
1258+ new SimpleResponse <>(response .getRequest (), response .getStatusCode (), response .getHeaders (),
1259+ new TableTransactionResult (transactionActions , response .getValue ())));
1260+ } catch (RuntimeException e ) {
1261+ return monoError (logger , e );
1262+ }
12391263 }
12401264
12411265 private Mono <Response <List <TableTransactionActionResponse >>> parseResponse (TransactionalBatchRequestBody requestBody ,
0 commit comments