提交 7419a591 编写于 作者: 彭勇升 pengys 提交者: wu-sheng

Supplement unexpected exception message. (#2389)

上级 7047c97e
...@@ -49,7 +49,7 @@ public enum IndicatorProcess { ...@@ -49,7 +49,7 @@ public enum IndicatorProcess {
try { try {
indicatorDAO = storageDAO.newIndicatorDao(builderClass.newInstance()); indicatorDAO = storageDAO.newIndicatorDao(builderClass.newInstance());
} catch (InstantiationException | IllegalAccessException e) { } catch (InstantiationException | IllegalAccessException e) {
throw new UnexpectedException(""); throw new UnexpectedException("Create " + builderClass.getSimpleName() + " indicator DAO failure.", e);
} }
IndicatorPersistentWorker minutePersistentWorker = minutePersistentWorker(moduleManager, indicatorDAO, modelName); IndicatorPersistentWorker minutePersistentWorker = minutePersistentWorker(moduleManager, indicatorDAO, modelName);
......
...@@ -50,7 +50,8 @@ public enum RecordProcess { ...@@ -50,7 +50,8 @@ public enum RecordProcess {
try { try {
recordDAO = storageDAO.newRecordDao(builderClass.newInstance()); recordDAO = storageDAO.newRecordDao(builderClass.newInstance());
} catch (InstantiationException | IllegalAccessException e) { } catch (InstantiationException | IllegalAccessException e) {
throw new UnexpectedException(""); throw new UnexpectedException("Create " + builderClass.getSimpleName() + " record DAO failure.", e);
} }
RecordPersistentWorker persistentWorker = new RecordPersistentWorker(WorkerIdGenerator.INSTANCES.generate(), modelName, RecordPersistentWorker persistentWorker = new RecordPersistentWorker(WorkerIdGenerator.INSTANCES.generate(), modelName,
......
...@@ -50,7 +50,7 @@ public enum TopNProcess { ...@@ -50,7 +50,7 @@ public enum TopNProcess {
try { try {
recordDAO = storageDAO.newRecordDao(builderClass.newInstance()); recordDAO = storageDAO.newRecordDao(builderClass.newInstance());
} catch (InstantiationException | IllegalAccessException e) { } catch (InstantiationException | IllegalAccessException e) {
throw new UnexpectedException(""); throw new UnexpectedException("Create " + builderClass.getSimpleName() + " top n record DAO failure.", e);
} }
TopNWorker persistentWorker = new TopNWorker(WorkerIdGenerator.INSTANCES.generate(), modelName, moduleManager, TopNWorker persistentWorker = new TopNWorker(WorkerIdGenerator.INSTANCES.generate(), modelName, moduleManager,
......
...@@ -49,7 +49,7 @@ public enum InventoryProcess { ...@@ -49,7 +49,7 @@ public enum InventoryProcess {
try { try {
registerDAO = storageDAO.newRegisterDao(builderClass.newInstance()); registerDAO = storageDAO.newRegisterDao(builderClass.newInstance());
} catch (InstantiationException | IllegalAccessException e) { } catch (InstantiationException | IllegalAccessException e) {
throw new UnexpectedException(""); throw new UnexpectedException("Create " + builderClass.getSimpleName() + " register DAO failure.", e);
} }
RegisterPersistentWorker persistentWorker = new RegisterPersistentWorker(WorkerIdGenerator.INSTANCES.generate(), modelName, moduleManager, registerDAO, scopeId); RegisterPersistentWorker persistentWorker = new RegisterPersistentWorker(WorkerIdGenerator.INSTANCES.generate(), modelName, moduleManager, registerDAO, scopeId);
......
...@@ -31,7 +31,7 @@ public class StorageEntityAnnotationUtils { ...@@ -31,7 +31,7 @@ public class StorageEntityAnnotationUtils {
StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class); StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class);
return annotation.name(); return annotation.name();
} else { } else {
throw new UnexpectedException(""); throw new UnexpectedException("Fail to get model name from class " + aClass.getSimpleName());
} }
} }
...@@ -40,7 +40,7 @@ public class StorageEntityAnnotationUtils { ...@@ -40,7 +40,7 @@ public class StorageEntityAnnotationUtils {
StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class); StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class);
return annotation.deleteHistory(); return annotation.deleteHistory();
} else { } else {
throw new UnexpectedException(""); throw new UnexpectedException("Fail to get delete history tag from class " + aClass.getSimpleName());
} }
} }
...@@ -49,7 +49,7 @@ public class StorageEntityAnnotationUtils { ...@@ -49,7 +49,7 @@ public class StorageEntityAnnotationUtils {
StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class); StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class);
return annotation.builder(); return annotation.builder();
} else { } else {
throw new UnexpectedException(""); throw new UnexpectedException("Fail to get entity builder from class " + aClass.getSimpleName());
} }
} }
...@@ -58,7 +58,7 @@ public class StorageEntityAnnotationUtils { ...@@ -58,7 +58,7 @@ public class StorageEntityAnnotationUtils {
StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class); StorageEntity annotation = (StorageEntity)aClass.getAnnotation(StorageEntity.class);
return annotation.sourceScopeId(); return annotation.sourceScopeId();
} else { } else {
throw new UnexpectedException(""); throw new UnexpectedException("Fail to get source scope from class " + aClass.getSimpleName());
} }
} }
} }
...@@ -55,7 +55,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO { ...@@ -55,7 +55,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO {
public List<Call> loadSpecifiedServerSideServiceRelations(Step step, long startTB, long endTB, public List<Call> loadSpecifiedServerSideServiceRelations(Step step, long startTB, long endTB,
List<Integer> serviceIds) throws IOException { List<Integer> serviceIds) throws IOException {
if (CollectionUtils.isEmpty(serviceIds)) { if (CollectionUtils.isEmpty(serviceIds)) {
throw new UnexpectedException("Service id is null"); throw new UnexpectedException("Service id is empty");
} }
SearchSourceBuilder sourceBuilder = SearchSourceBuilder.searchSource(); SearchSourceBuilder sourceBuilder = SearchSourceBuilder.searchSource();
...@@ -70,7 +70,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO { ...@@ -70,7 +70,7 @@ public class TopologyQueryEsDAO extends EsDAO implements ITopologyQueryDAO {
public List<Call> loadSpecifiedClientSideServiceRelations(Step step, long startTB, long endTB, public List<Call> loadSpecifiedClientSideServiceRelations(Step step, long startTB, long endTB,
List<Integer> serviceIds) throws IOException { List<Integer> serviceIds) throws IOException {
if (CollectionUtils.isEmpty(serviceIds)) { if (CollectionUtils.isEmpty(serviceIds)) {
throw new UnexpectedException("Service id is null"); throw new UnexpectedException("Service id is empty");
} }
SearchSourceBuilder sourceBuilder = SearchSourceBuilder.searchSource(); SearchSourceBuilder sourceBuilder = SearchSourceBuilder.searchSource();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册