Skip to content

Commit aac5001

Browse files
author
tnscorcoran
committed
fix for alert:' [3scale_ws_api_for_java] ServerAccessorDriver NullPointerException (3scale-labs#23)'
1 parent 273d64d commit aac5001

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/threescale/v3/api/impl/ServerAccessorDriver.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public HttpResponse get(final String urlParams) throws ServerError {
7575
} catch (IOException e) {
7676
throw new ServerError(e.getMessage());
7777
}
78+
} catch (NullPointerException npe) {
79+
throw new ServerError("NullPointerException thrown ServerAccessorDriver::get, urlParams were "+urlParams);
7880
} finally {
7981
if (connection != null) {
8082
connection.disconnect();
@@ -136,7 +138,9 @@ public HttpResponse post(final String urlParams,final String data) throws Server
136138
} catch (IOException e) {
137139
throw new ServerError(e.getMessage());
138140
}
139-
} finally {
141+
} catch (NullPointerException npe) {
142+
throw new ServerError("NullPointerException thrown ServerAccessorDriver::post, urlParams were "+urlParams+", data was "+data);
143+
}finally {
140144
if (connection != null) {
141145
connection.disconnect();
142146
}

0 commit comments

Comments
 (0)