Adding missed error throwing

reporting
inoshperera 5 years ago
parent 08ee99f034
commit 45bfadb657

@ -316,14 +316,26 @@ public class RequestValidationUtil {
log.error("No policy validator found for device type " + deviceType);
}
} catch (InstantiationException e) {
log.error("Error when creating an instance of validator related to deviceType " +
deviceType);
String msg = "Error when creating an instance of validator related to deviceType " +
deviceType;
log.error(msg);
throw new InputValidationException(
new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(msg).build
());
} catch (IllegalAccessException e) {
log.error("Error when accessing an instance of validator related to deviceType " +
deviceType);
String msg = "Error when accessing an instance of validator related to deviceType " +
deviceType;
log.error(msg);
throw new InputValidationException(
new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(msg).build
());
} catch (ClassNotFoundException e) {
log.error("Error when loading an instance of validator related to deviceType " +
deviceType);
String msg ="Error when loading an instance of validator related to deviceType " +
deviceType;
log.error(msg);
throw new InputValidationException(
new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(msg).build
());
}
return null;
}

@ -1,3 +1,21 @@
/*
* Copyright (c) 2020, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (Pvt) Ltd. licenses this file to you 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.
*
*/
package org.wso2.carbon.policy.mgt.common;
import java.util.List;

@ -1,7 +1,7 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2020, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Entgra (Pvt) Ltd. licenses this file to you 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
@ -14,6 +14,7 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.wso2.carbon.policy.mgt.common;

Loading…
Cancel
Save