From: Steven Blimkie Date: Wed, 28 Mar 2018 14:14:51 +0000 (+0000) Subject: Merge "Catch IllegalArgumentException for error message" X-Git-Tag: v1.2.2~18 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=533b090aa92f5eaa6c674fd63940fcacf4dc811e;hp=342dbc8a4af828aa7e918138dc693b9d4f85c2a0;p=aai%2Fchamp.git Merge "Catch IllegalArgumentException for error message" --- diff --git a/champ-lib/pom.xml b/champ-lib/pom.xml index 921e733..43fa296 100644 --- a/champ-lib/pom.xml +++ b/champ-lib/pom.xml @@ -41,7 +41,7 @@ limitations under the License. UTF-8 - 1.2.0 + 1.2.1 diff --git a/champ-service/pom.xml b/champ-service/pom.xml index 2168783..b0dbf46 100644 --- a/champ-service/pom.xml +++ b/champ-service/pom.xml @@ -48,7 +48,7 @@ limitations under the License. /appl/${project.artifactId}/${project.version} org.onap.aai.logging-service - 1.2.0 + 1.2.2 4.5.2 ${basedir}/target diff --git a/champ-service/src/main/java/org/onap/champ/ChampRESTAPI.java b/champ-service/src/main/java/org/onap/champ/ChampRESTAPI.java index 08b602a..b75ba53 100644 --- a/champ-service/src/main/java/org/onap/champ/ChampRESTAPI.java +++ b/champ-service/src/main/java/org/onap/champ/ChampRESTAPI.java @@ -204,6 +204,8 @@ public class ChampRESTAPI { response = Response.status(Status.BAD_REQUEST).entity("Unable to parse the payload").build(); } catch (ChampServiceException ce) { response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build(); + } catch (IllegalArgumentException e) { + response = Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build(); } catch (Exception e) { response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); LoggingUtil.logInternalError(logger, e); @@ -242,6 +244,8 @@ public class ChampRESTAPI { response = Response.status(Status.BAD_REQUEST).entity("Unable to parse the payload").build(); } catch (ChampServiceException ce) { response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build(); + } catch (IllegalArgumentException e) { + response = Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build(); } catch (Exception e) { response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); LoggingUtil.logInternalError(logger, e); @@ -386,6 +390,8 @@ public class ChampRESTAPI { response = Response.status(Status.BAD_REQUEST).entity("Unable to parse the payload").build(); } catch (ChampServiceException ce) { response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build(); + } catch (IllegalArgumentException e) { + response = Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build(); } catch (Exception e) { response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); LoggingUtil.logInternalError(logger, e); @@ -422,6 +428,8 @@ public class ChampRESTAPI { response = Response.status(Status.BAD_REQUEST).entity("Unable to parse the payload").build(); } catch (ChampServiceException ce) { response = Response.status(ce.getHttpStatus()).entity(ce.getMessage()).build(); + } catch (IllegalArgumentException e) { + response = Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build(); } catch (Exception e) { response = Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); LoggingUtil.logInternalError(logger, e);