Skip to content

Commit c298b88

Browse files
add missing calls
1 parent 24b02fc commit c298b88

3 files changed

Lines changed: 855 additions & 299 deletions

File tree

src/main/java/com/testingbot/testingbotrest/TestingbotApiException.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,33 @@
22

33
public class TestingbotApiException extends RuntimeException {
44

5-
TestingbotApiException(String payload) {
6-
super(payload);
5+
private static final long serialVersionUID = 1L;
6+
7+
private final int statusCode;
8+
private final String responseBody;
9+
10+
public TestingbotApiException(String payload) {
11+
this(payload, 0, payload);
12+
}
13+
14+
public TestingbotApiException(String message, int statusCode, String responseBody) {
15+
super(message);
16+
this.statusCode = statusCode;
17+
this.responseBody = responseBody;
18+
}
19+
20+
/**
21+
* @return the HTTP status code returned by the TestingBot API, or 0 when the
22+
* failure was not an HTTP response (e.g. a transport or parsing error).
23+
*/
24+
public int getStatusCode() {
25+
return statusCode;
26+
}
27+
28+
/**
29+
* @return the raw response body returned by the TestingBot API, if any.
30+
*/
31+
public String getResponseBody() {
32+
return responseBody;
733
}
834
}

0 commit comments

Comments
 (0)