Skip to content

Commit

Permalink
Rename AutoRestException to RestException
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghaolu committed Apr 15, 2016
1 parent a6feaf0 commit fc7d9a9
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion azure-android-client-authentication/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.microsoft.aad:adal:1.1.11'
compile 'com.microsoft.rest:client-runtime:1.0.0-beta1'
compile 'com.microsoft.rest:client-runtime:1.0.0-SNAPSHOT'
testCompile 'junit:junit:4.12'
testCompile 'junit:junit-dep:4.11'
deployerJars "org.apache.maven.wagon:wagon-ftp:2.10"
Expand Down
2 changes: 1 addition & 1 deletion azure-client-authentication/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ checkstyle {

dependencies {
compile 'com.microsoft.azure:adal4j:1.1.2'
compile 'com.microsoft.rest:client-runtime:1.0.0-beta1'
compile 'com.microsoft.rest:client-runtime:1.0.0-SNAPSHOT'
testCompile 'junit:junit:4.12'
testCompile 'junit:junit-dep:4.11'
deployerJars "org.apache.maven.wagon:wagon-ftp:2.10"
Expand Down
2 changes: 1 addition & 1 deletion azure-client-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ checkstyle {
}

dependencies {
compile 'com.microsoft.rest:client-runtime:1.0.0-beta1'
compile 'com.microsoft.rest:client-runtime:1.0.0-SNAPSHOT'
testCompile 'junit:junit:4.12'
testCompile 'junit:junit-dep:4.11'
deployerJars "org.apache.maven.wagon:wagon-ftp:2.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package com.microsoft.azure;

import com.google.common.reflect.TypeToken;
import com.microsoft.rest.AutoRestException;
import com.microsoft.rest.RestException;
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.ServiceResponseBuilder;
import com.microsoft.rest.serializer.JacksonMapperAdapter;
Expand All @@ -27,7 +27,7 @@
* @param <T> the return type from caller.
* @param <E> the exception to throw in case of error.
*/
public class AzureServiceResponseBuilder<T, E extends AutoRestException> extends ServiceResponseBuilder<T, E> {
public class AzureServiceResponseBuilder<T, E extends RestException> extends ServiceResponseBuilder<T, E> {
/**
* Create a ServiceResponseBuilder instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

package com.microsoft.azure;

import com.microsoft.rest.AutoRestException;
import com.microsoft.rest.RestException;
import retrofit2.Response;

/**
* Exception thrown for an invalid response with custom error information.
*/
public class CloudException extends AutoRestException {
public class CloudException extends RestException {
/**
* Information about the associated HTTP response.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package com.microsoft.azure;

import com.microsoft.rest.AutoRestException;
import com.microsoft.rest.RestException;

import java.io.IOException;
import java.util.Collection;
Expand Down Expand Up @@ -46,10 +46,10 @@ public PagedList(Page<E> page) {
*
* @param nextPageLink the link to get the next page of items.
* @return the {@link Page} object storing a page of items and a link to the next page.
* @throws AutoRestException thrown if an error is raised from Azure.
* @throws RestException thrown if an error is raised from Azure.
* @throws IOException thrown if there's any failure in deserialization.
*/
public abstract Page<E> nextPage(String nextPageLink) throws AutoRestException, IOException;
public abstract Page<E> nextPage(String nextPageLink) throws RestException, IOException;

/**
* If there are more pages available.
Expand All @@ -69,7 +69,7 @@ public void loadNextPage() {
Page<E> nextPage = nextPage(this.nextPageLink);
this.nextPageLink = nextPage.getNextPageLink();
this.items.addAll(nextPage.getItems());
} catch (AutoRestException e) {
} catch (RestException e) {
throw new WebServiceException(e.toString(), e);
} catch (IOException e) {
throw new DataBindingException(e.getMessage(), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
/**
* Exception thrown for an invalid response with custom error information.
*/
public abstract class AutoRestException extends Exception {
public abstract class RestException extends Exception {
/**
* Initializes a new instance of the AutoRestException class.
*/
public AutoRestException() { }
public RestException() { }

/**
* Initializes a new instance of the AutoRestException class.
*
* @param message The exception message.
*/
public AutoRestException(String message) {
public RestException(String message) {
super(message);
}

Expand All @@ -30,7 +30,7 @@ public AutoRestException(String message) {
*
* @param cause exception that caused this exception to occur
*/
public AutoRestException(Throwable cause) {
public RestException(Throwable cause) {
super(cause);
}

Expand All @@ -40,7 +40,7 @@ public AutoRestException(Throwable cause) {
* @param message the exception message
* @param cause exception that caused this exception to occur
*/
public AutoRestException(String message, Throwable cause) {
public RestException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Exception thrown for an invalid response with custom error information.
*/
public class ServiceException extends AutoRestException {
public class ServiceException extends RestException {
/**
* Information about the associated HTTP response.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @param <T> The return type the caller expects from the REST response.
* @param <E> the exception to throw in case of error.
*/
public class ServiceResponseBuilder<T, E extends AutoRestException> {
public class ServiceResponseBuilder<T, E extends RestException> {
/**
* A mapping of HTTP status codes and their corresponding return types.
*/
Expand All @@ -36,7 +36,7 @@ public class ServiceResponseBuilder<T, E extends AutoRestException> {
/**
* The exception type to thrown in case of error.
*/
protected Class<? extends AutoRestException> exceptionType;
protected Class<? extends RestException> exceptionType;

/**
* The mapperAdapter used for deserializing the response.
Expand Down Expand Up @@ -83,7 +83,7 @@ public ServiceResponseBuilder<T, E> register(int statusCode, final Type type) {
* @param type the type to deserialize.
* @return the same builder instance.
*/
public ServiceResponseBuilder<T, E> registerError(final Class<? extends AutoRestException> type) {
public ServiceResponseBuilder<T, E> registerError(final Class<? extends RestException> type) {
this.exceptionType = type;
try {
Field f = type.getDeclaredField("body");
Expand Down

0 comments on commit fc7d9a9

Please sign in to comment.