Merge branch 'feature/SUPPORT-8725_refactor_for_dev' into develop

This commit is contained in:
adel.ka 2024-12-17 16:51:18 +03:00
commit ceecd93b79
7 changed files with 48 additions and 7 deletions

View file

@ -14,6 +14,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import ru.micord.ervu_dashboard.exception.AppInitializeException;
import javax.sql.DataSource;
@ -69,7 +70,7 @@ public class AppConfig {
return connection.getMetaData().getUserName();
}
catch (SQLException e) {
throw new RuntimeException(e);
throw new AppInitializeException(e);
}
}
@ -84,10 +85,10 @@ public class AppConfig {
LOGGER.info("ervu_dashboard schema was created");
} catch (SQLException e) {
connection.rollback();
throw new RuntimeException(e);
throw new AppInitializeException(e);
}
} catch (SQLException e) {
throw new RuntimeException(e);
throw new AppInitializeException(e);
}
}
}

View file

@ -22,6 +22,7 @@ import component.chart.service.SingleChartDataSetService;
import component.chart.service.impl.AbstractChartDatasetService;
import ru.micord.ervu_dashboard.component.chart.label.RoundLabelConfiguration;
import ru.micord.ervu_dashboard.component.filter.FilterReferences;
import ru.micord.ervu_dashboard.exception.ChartDataLoadException;
import ru.micord.ervu_dashboard.model.chart.round.RoundAggregationData;
import ru.micord.ervu_dashboard.model.chart.round.RoundChartColumnSort;
import ru.micord.ervu_dashboard.model.chart.round.RoundChartDataDto;
@ -111,7 +112,7 @@ public class RoundSingleChartDataSetService extends AbstractChartDatasetService
}
catch (InterruptedException | ExecutionException e) {
executorService.shutdownNow();
throw new RuntimeException(e);
throw new ChartDataLoadException(e);
}
}

View file

@ -1,6 +1,6 @@
package ru.micord.ervu_dashboard.controller;
import ru.micord.ervu_dashboard.sevice.DataDateService;
import ru.micord.ervu_dashboard.service.DataDateService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

View file

@ -0,0 +1,19 @@
package ru.micord.ervu_dashboard.exception;
/**
* @author Adel Kalimullin
*/
public class AppInitializeException extends RuntimeException{
public AppInitializeException(String message){
super(message);
}
public AppInitializeException(String message, Throwable cause){
super(message, cause);
}
public AppInitializeException(Throwable cause) {
super(cause);
}
}

View file

@ -0,0 +1,19 @@
package ru.micord.ervu_dashboard.exception;
/**
* @author Adel Kalimullin
*/
public class ChartDataLoadException extends RuntimeException {
public ChartDataLoadException(String message, Throwable cause) {
super(message, cause);
}
public ChartDataLoadException(Throwable cause) {
super(cause);
}
public ChartDataLoadException(String message) {
super(message);
}
}

View file

@ -1,4 +1,4 @@
package ru.micord.ervu_dashboard.sevice;
package ru.micord.ervu_dashboard.service;
import java.sql.Date;
import java.text.SimpleDateFormat;

View file

@ -13,6 +13,7 @@ import component.field.dataconvert.DataConverterProvider;
import component.field.loading.FieldDefaultValue;
import component.field.loading.LoadType;
import model.FieldData;
import ru.micord.ervu_dashboard.exception.AppInitializeException;
import ru.cg.webbpm.modules.database.api.bean.TableRow;
import ru.cg.webbpm.modules.database.api.dao.LoadDao;
@ -46,7 +47,7 @@ public class ProjectDefaultValueLoaderServiceImpl extends AbstractDefaultValueLo
return entry.getValue().getDefaultValueColumn();
}
catch (Exception e) {
throw new RuntimeException(
throw new AppInitializeException(
String.format("Cannot load values for object with id = %s",
entry.getKey()
), e);