Skip to content

Commit 810699d

Browse files
tobiasakeemichaf
authored andcommitted
Fix HTTP ERROR return code when doing RestPost requests. (#81)
* Update SpringRestTemplate.java * Stepped version in pom file.
1 parent 270a117 commit 810699d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.github.ericsson</groupId>
55
<artifactId>eiffel-intelligence</artifactId>
6-
<version>0.0.4</version>
6+
<version>0.0.5</version>
77

88
<packaging>war</packaging>
99

src/main/java/com/ericsson/ei/subscriptionhandler/SpringRestTemplate.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ public int postDataMultiValue(String notificationMeta, MultiValueMap<String, Str
7171
}
7272
} catch (Exception e) {
7373
log.error(e.getMessage(), e);
74-
return HttpStatus.NOT_FOUND.value();
74+
try {
75+
return Integer.parseInt(e.getMessage());
76+
}
77+
catch (NumberFormatException error) {
78+
return HttpStatus.NOT_FOUND.value();
79+
}
7580
}
7681
HttpStatus status = response.getStatusCode();
7782
log.info("The response code after POST is : " + status);

0 commit comments

Comments
 (0)