From d0eb17812b25413f9937fda1e434d53d14d4214d Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 12 Mar 2021 18:21:48 +0100 Subject: [PATCH] Improved returned error messages --- CHANGELOG.md | 3 ++- pom.xml | 2 +- src/main/java/org/gcube/gcat/utils/HTTPUtility.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e46ecde..04bfc80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for gCube Catalogue (gCat) Service -## [v1.4.5] +## [v1.4.5-SNAPSHOT] - Removed 'owner_org' field from result when reading an item #20919 - Dirty patched item validator [#20965] +- Improved error message return with message got from CKAN [#19516] ## [v1.4.4] diff --git a/pom.xml b/pom.xml index 846409a..bc69839 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.gcube.data-publishing gcat war - 1.4.5 + 1.4.5-SNAPSHOT gCube Catalogue (gCat) Service This service allows any client to publish on the gCube Catalogue. diff --git a/src/main/java/org/gcube/gcat/utils/HTTPUtility.java b/src/main/java/org/gcube/gcat/utils/HTTPUtility.java index e31bbea..5bedb90 100644 --- a/src/main/java/org/gcube/gcat/utils/HTTPUtility.java +++ b/src/main/java/org/gcube/gcat/utils/HTTPUtility.java @@ -51,7 +51,7 @@ public class HTTPUtility { InputStream inputStream = httpURLConnection.getErrorStream(); StringBuilder result = getStringBuilder(inputStream); logger.trace(result.toString()); - throw new WebApplicationException(status); + throw new WebApplicationException(result.toString(), status); } InputStream inputStream = httpURLConnection.getInputStream(); String ret = getStringBuilder(inputStream).toString();