Improving HTTP Response code to be more standard.
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-api@146776 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ee4b037c96
commit
b16e6cf039
|
@ -226,13 +226,13 @@ public class HTTPCall {
|
||||||
if(responseCode == HttpURLConnection.HTTP_NOT_FOUND){
|
if(responseCode == HttpURLConnection.HTTP_NOT_FOUND){
|
||||||
throw getElementNotFoundException(clz);
|
throw getElementNotFoundException(clz);
|
||||||
}
|
}
|
||||||
if(responseCode == HttpURLConnection.HTTP_CONFLICT){
|
if(responseCode == HttpURLConnection.HTTP_FORBIDDEN){
|
||||||
throw getElementAvailableInAnotherContextException(clz);
|
throw getElementAvailableInAnotherContextException(clz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (responseCode != HttpURLConnection.HTTP_OK) {
|
if (responseCode >= HttpURLConnection.HTTP_BAD_REQUEST) {
|
||||||
|
|
||||||
InputStream inputStream = connection.getErrorStream();
|
InputStream inputStream = connection.getErrorStream();
|
||||||
StringBuilder result = getStringBuilder(inputStream);
|
StringBuilder result = getStringBuilder(inputStream);
|
||||||
|
|
Loading…
Reference in New Issue