use of com.emc.storageos.svcs.errorhandling.annotations.DeclareServiceCode in project coprhd-controller by CoprHD.
the class ExceptionMessagesProxy method serviceCode.
/**
* Get the specified {@link ServiceCode} from the {@link DeclareServiceCode} annotation
*
* @param method
* @return
*/
private ServiceCode serviceCode(final Method method) {
final DeclareServiceCode declaredServiceCode = method.getAnnotation(DeclareServiceCode.class);
if (declaredServiceCode == null) {
throw new IllegalStateException("A service code must be provided via @DeclareServiceCode");
}
final ServiceCode serviceCode = declaredServiceCode.value();
return serviceCode;
}
Aggregations