From 82c94daf74c08f111f6ce31c832df3f5583b14f7 Mon Sep 17 00:00:00 2001 From: olegb Date: Sun, 3 Jun 2018 07:55:57 +0300 Subject: Error pop-up contain empty/internal information Issue-ID: SDC-1393 Change-Id: Ibb60e21431bb886dd7dd499202cf226af3e2465d Signed-off-by: Oleg Beltz --- .../sdcrests/errors/DefaultExceptionMapper.java | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'openecomp-be/api') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java index 28917b9fb7..098a89d6ff 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java @@ -1,21 +1,17 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ +/* + * Copyright © 2016-2018 European Support Limited + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * ============LICENSE_END========================================================= */ package org.openecomp.sdcrests.errors; @@ -54,7 +50,7 @@ public class DefaultExceptionMapper implements ExceptionMapper { FileUtils.readViaInputStream(ERROR_CODES_TO_RESPONSE_STATUS_MAPPING_FILE, stream -> JsonUtil.json2Object(stream, Map.class)); - private static final Logger LOGGER = (Logger) LoggerFactory.getLogger(DefaultExceptionMapper + private static final Logger LOGGER = LoggerFactory.getLogger(DefaultExceptionMapper .class); @Override @@ -147,11 +143,11 @@ public class DefaultExceptionMapper implements ExceptionMapper { } private Response transform(Exception exception) { - ErrorCode generalErrorCode = new GeneralErrorBuilder(exception.getMessage()).build(); - LOGGER.error(generalErrorCode.message(), exception); + ErrorCode errorCode = new GeneralErrorBuilder().build(); + LOGGER.error(errorCode.message(), exception); return Response .status(Response.Status.INTERNAL_SERVER_ERROR) - .entity(toEntity(Response.Status.INTERNAL_SERVER_ERROR, generalErrorCode)) + .entity(toEntity(Response.Status.INTERNAL_SERVER_ERROR, errorCode)) .build(); } -- cgit 1.2.3-korg