Skip to content

Commit 8e76419

Browse files
committed
fix: Fix error propagation in Java (box/box-codegen#936)
1 parent d9ff755 commit 8e76419

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "acae1d5", "specHash": "f8e0d99", "version": "10.7.0" }
1+
{ "engineHash": "51c2138", "specHash": "f8e0d99", "version": "10.7.0" }

docs/authentication.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,9 @@ browser or web view) in order to obtain an auth code.
215215
<!-- sample get_authorize -->
216216

217217
```java
218-
BoxOAuth oauth = new OAuthConfig("CLIENT_ID", "CLIENT_SECRET");
219-
String authorizationUrl = auoauthth.getAuthorizeUrl();
218+
OAuthConfig oauthConfig = new OAuthConfig("CLIENT_ID", "CLIENT_SECRET");
219+
BoxOAuth oauth = new BoxOAuth(oauthConfig);
220+
String authorizationUrl = oauth.getAuthorizeUrl();
220221
```
221222

222223
After a user logs in and grants your application access to their Box account,

src/main/java/com/box/sdkgen/networking/boxnetworkclient/BoxNetworkClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ public FetchResponse fetch(FetchOptions options) {
196196
exceptionThrown = e;
197197
numberOfRetriesOnException++;
198198
attemptForRetry = numberOfRetriesOnException;
199+
fetchResponse = new FetchResponse.Builder(0, new TreeMap<>()).build();
200+
rawResponseBody = null;
199201
if (response != null) {
200202
response.close();
201203
}

src/main/java/com/box/sdkgen/networking/defaultnetworkclient/DefaultNetworkClient.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,10 @@ public FetchResponse fetch(FetchOptions options) {
113113
exceptionThrown = e;
114114
numberOfRetriesOnException++;
115115
attemptForRetry = numberOfRetriesOnException;
116+
fetchResponse = new FetchResponse.Builder(0, new TreeMap<>()).build();
116117
if (response != null) {
117118
response.close();
118119
}
119-
120-
fetchResponse =
121-
new FetchResponse.Builder(0, new TreeMap<>(String.CASE_INSENSITIVE_ORDER)).build();
122120
}
123121

124122
shouldRetry =

0 commit comments

Comments
 (0)