Skip to content

Commit

Permalink
Error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jessica-gavaGN committed May 11, 2021
1 parent 04b92cb commit bacf7c6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.2

- Fix: Error message

# 1.0.1

- Fix: Error message
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ java 7.0 and 8.0
**Via gradle:**

```gradle
compile 'br.com.gerencianet.gnsdk:gn-api-sdk-java:1.0.1'
compile 'br.com.gerencianet.gnsdk:gn-api-sdk-java:1.0.2'
```

**Via maven:**
Expand All @@ -31,7 +31,7 @@ compile 'br.com.gerencianet.gnsdk:gn-api-sdk-java:1.0.1'
<dependency>
    <groupId>br.com.gerencianet.gnsdk</groupId>
    <artifactId>gn-api-sdk-java</artifactId>
    <version>1.0.1</version>
    <version>1.0.2</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.gerencianet.gnsdk</groupId>
<artifactId>gn-api-sdk-java</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>

<name>GN API SDK JAVA</name>
<description>Java SDK for integrating with Gerencianet API</description>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/gerencianet/gnsdk/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
*/
public class Config {
private final static String version = "1.0.1";
private final static String version = "1.0.2";
private JSONObject conf = new JSONObject();
private JSONObject endpoints = new JSONObject();
private JSONObject urls = new JSONObject();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/br/com/gerencianet/gnsdk/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public JSONObject send(JSONObject requestOptions) throws AuthorizationException,
JSONTokener responseTokener = new JSONTokener(responseStream);
return new JSONObject(responseTokener);
}
else if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED ) {
else if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED || responseCode == HttpURLConnection.HTTP_FORBIDDEN) {
throw new AuthorizationException();
} else {
InputStream responseStream = client.getErrorStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ public GerencianetException(JSONObject response) {
this.error = response.get("error").toString();
this.errorDescription = message;

} else

message = response.get("mensagem").toString();
this.error = response.get("nome").toString();
this.errorDescription = message;
} else {
this.error = response.get("nome").toString();
this.errorDescription = response.get("mensagem").toString();
}
}

public String getError() {
Expand Down

0 comments on commit bacf7c6

Please sign in to comment.