Skip to content

Commit

Permalink
Tables exception and error classes changes. (#21339)
Browse files Browse the repository at this point in the history
* Renamed TableServiceErrorException to TableServiceException.

* Made TableErrorCode final and added a lot more error codes to it.

* Removed languageCode from TableServiceError.

* Corrected error values in TableErrorCode.

* Removed unused error codes from TableErrorCode.

* Imported TableServiceErrorException in TableUtils instead of using it's fully qualified name.

* Added a link for getting error codes details to TableErrorCode's JavaDoc.

* Removed localization from link in TableErrorCode.
  • Loading branch information
vcolin7 authored May 13, 2021
1 parent 434ca67 commit 60517da
Show file tree
Hide file tree
Showing 17 changed files with 393 additions and 248 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.azure.data.tables.implementation.models.BatchSubRequest;
import com.azure.data.tables.implementation.models.TableServiceError;
import com.azure.data.tables.models.TableEntity;
import com.azure.data.tables.models.TableServiceErrorException;
import com.azure.data.tables.models.TableServiceException;
import com.azure.data.tables.models.UpdateMode;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
Expand Down Expand Up @@ -253,7 +253,7 @@ public synchronized List<BatchOperation> getOperations() {
* @return A reactive result containing a list of sub-responses for each operation in the batch.
*
* @throws IllegalStateException If no operations have been added to the batch.
* @throws TableServiceErrorException if any operation within the batch fails. See the documentation for the client
* @throws TableServiceException if any operation within the batch fails. See the documentation for the client
* methods in {@link TableAsyncClient} to understand the conditions that may cause a given operation to fail.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -269,7 +269,7 @@ public synchronized Mono<List<BatchOperationResponse>> submitTransaction() {
* contain a list of sub-responses for each operation in the batch.
*
* @throws IllegalStateException If no operations have been added to the batch.
* @throws TableServiceErrorException if any operation within the batch fails. See the documentation for the client
* @throws TableServiceException if any operation within the batch fails. See the documentation for the client
* methods in {@link TableAsyncClient} to understand the conditions that may cause a given operation to fail.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down Expand Up @@ -355,7 +355,7 @@ private Mono<Response<List<BatchOperationResponse>>> parseResponse(BatchRequestB
message += " " + errorMessage;
}

return monoError(logger, new TableServiceErrorException(message, null, toTableServiceError(error)));
return monoError(logger, new TableServiceException(message, null, toTableServiceError(error)));
} else {
return Mono.just(new SimpleResponse<>(response, Arrays.asList(response.getValue())));
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.azure.data.tables.implementation.models.BatchOperation;
import com.azure.data.tables.models.BatchOperationResponse;
import com.azure.data.tables.models.TableEntity;
import com.azure.data.tables.models.TableServiceErrorException;
import com.azure.data.tables.models.TableServiceException;
import com.azure.data.tables.models.UpdateMode;

import java.time.Duration;
Expand Down Expand Up @@ -224,7 +224,7 @@ public List<BatchOperation> getOperations() {
* @return A list of sub-responses for each operation in the batch.
*
* @throws IllegalStateException If no operations have been added to the batch.
* @throws TableServiceErrorException if any operation within the batch fails. See the documentation for the client
* @throws TableServiceException if any operation within the batch fails. See the documentation for the client
* methods in {@link TableClient} to understand the conditions that may cause a given operation to fail.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -241,7 +241,7 @@ public List<BatchOperationResponse> submitTransaction() {
* @return A list of sub-responses for each operation in the batch.
*
* @throws IllegalStateException If no operations have been added to the batch.
* @throws TableServiceErrorException if any operation within the batch fails. See the documentation for the client
* @throws TableServiceException if any operation within the batch fails. See the documentation for the client
* methods in {@link TableClient} to understand the conditions that may cause a given operation to fail.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand All @@ -260,7 +260,7 @@ public List<BatchOperationResponse> submitTransaction(Duration timeout) {
* sub-responses for each operation in the batch.
*
* @throws IllegalStateException If no operations have been added to the batch.
* @throws TableServiceErrorException if any operation within the batch fails. See the documentation for the client
* @throws TableServiceException if any operation within the batch fails. See the documentation for the client
* methods in {@link TableClient} to understand the conditions that may cause a given operation to fail.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Expand Down
Loading

0 comments on commit 60517da

Please sign in to comment.