io.mosip.admin.constant.AuthAdapterErrorCode Maven / Gradle / Ivy
package io.mosip.admin.constant;
/**
* Error Code for Auth Adapter
*
* @author Urvil Joshi
* @since 1.0.0
*
*/
public enum AuthAdapterErrorCode {
/**
* UNAUTHORIZED
*/
UNAUTHORIZED("KER-ATH-401", "Authentication Failed"),
/**
* FORBIDDEN
*/
FORBIDDEN("KER-ATH-403", "Forbidden"),
/**
* FORBIDDEN
*/
CONNECT_EXCEPTION("KER-ATH-002", "Fail to connect to auth service"),
/**
* RESPONSE_PARSE_ERROR
*/
RESPONSE_PARSE_ERROR("KER-ATH-001", "Error occur while parsing error from response");
/**
* The error code
*/
private final String errorCode;
/**
* The error message
*/
private final String errorMessage;
/**
* Constructor to set error code and message
*
* @param errorCode the error code
* @param errorMessage the error message
*/
private AuthAdapterErrorCode(final String errorCode, final String errorMessage) {
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
/**
* Function to get error code
*
* @return {@link #errorCode}
*/
public String getErrorCode() {
return errorCode;
}
/**
* Function to get the error message
*
* @return {@link #errorMessage}r
*/
public String getErrorMessage() {
return errorMessage;
}
}