Skip to content

Commit 479abea

Browse files
author
stephen powis
committed
fix interface implementation
1 parent b750c97 commit 479abea

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/main/java/com/darksci/pardot/api/rest/HttpClientRestClient.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,15 @@ public void close() {
133133
* Make a request against the Pardot API.
134134
* @param request The request to submit.
135135
* @return The response, in UTF-8 String format.
136-
* @throws IOException if something goes wrong?
136+
* @throws RestException if something goes wrong.
137137
*/
138138
@Override
139-
public RestResponse submitRequest(final Request request) throws IOException {
140-
return submitRequest(request, new RestResponseHandler());
139+
public RestResponse submitRequest(final Request request) throws RestException {
140+
try {
141+
return submitRequest(request, new RestResponseHandler());
142+
} catch (IOException exception) {
143+
throw new RestException(exception.getMessage(), exception);
144+
}
141145
}
142146

143147
/**

src/main/java/com/darksci/pardot/api/rest/MockRestClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void init(final Configuration configuration) {
1919
}
2020

2121
@Override
22-
public RestResponse submitRequest(final Request request) throws IOException {
22+
public RestResponse submitRequest(final Request request) throws RestException {
2323
// Not implemented yet.
2424
return null;
2525
}

0 commit comments

Comments
 (0)