Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gcloud-java-dns/src/main/java/com/google/gcloud/dns/Dns.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public interface Dns extends Service<DnsOptions> {
* The fields of a project.
*
* <p>These values can be used to specify the fields to include in a partial response when calling
* {@link Dns#getProjectInfo(ProjectOption...)}. Project ID is always returned, even if not
* {@link Dns#getProject(ProjectOption...)}. Project ID is always returned, even if not
* specified.
*/
enum ProjectField {
Expand Down Expand Up @@ -429,7 +429,7 @@ public static ChangeRequestListOption sortOrder(SortingOrder order) {
* @see <a href="https://cloud.google.com/dns/api/v1/managedZones/create">Cloud DNS Managed Zones:
* create</a>
*/
ZoneInfo create(ZoneInfo zoneInfo, ZoneOption... options);
Zone create(ZoneInfo zoneInfo, ZoneOption... options);

This comment was marked as spam.

This comment was marked as spam.


/**
* Returns the zone by the specified zone name. Returns {@code null} if the zone is not found. The
Expand All @@ -439,7 +439,7 @@ public static ChangeRequestListOption sortOrder(SortingOrder order) {
* @see <a href="https://cloud.google.com/dns/api/v1/managedZones/get">Cloud DNS Managed Zones:
* get</a>
*/
ZoneInfo getZone(String zoneName, ZoneOption... options);
Zone getZone(String zoneName, ZoneOption... options);

/**
* Lists the zones inside the project.
Expand Down Expand Up @@ -485,7 +485,7 @@ public static ChangeRequestListOption sortOrder(SortingOrder order) {
* @throws DnsException upon failure
* @see <a href="https://cloud.google.com/dns/api/v1/projects/get">Cloud DNS Projects: get</a>
*/
ProjectInfo getProjectInfo(ProjectOption... fields);
ProjectInfo getProject(ProjectOption... fields);

/**
* Submits a change request for the specified zone. The returned object contains the following
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package com.google.gcloud.dns;

import com.google.gcloud.BaseServiceException;
import com.google.gcloud.RetryHelper.RetryHelperException;
import com.google.gcloud.RetryHelper.RetryInterruptedException;

import java.io.IOException;

Expand All @@ -31,5 +33,21 @@ public DnsException(IOException exception) {
super(exception, true);
}

public DnsException(int code, String message) {
super(code, message, null, true);
}

/**
* Translate RetryHelperException to the DnsException that caused the error. This method will
* always throw an exception.
*
* @throws DnsException when {@code ex} was caused by a {@code DnsException}
* @throws RetryInterruptedException when {@code ex} is a {@code RetryInterruptedException}
*/
static DnsException translateAndThrow(RetryHelperException ex) {
BaseServiceException.translateAndPropagateIfPossible(ex);
throw new DnsException(UNKNOWN_CODE, ex.getMessage());
}

This comment was marked as spam.

This comment was marked as spam.

//TODO(mderka) Add translation and retry functionality. Created issue #593.
}
Loading