Commit ee6f7988 authored by neo's avatar neo

[DEV] add log for exception

parent 6547493e
package pwc.taxtech.atms.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
......@@ -11,13 +13,20 @@ import pwc.taxtech.atms.exception.ServiceException;
@ControllerAdvice
public class AtmsExceptionHandler extends ResponseEntityExceptionHandler {
private static Logger LOGGER = LoggerFactory.getLogger(AtmsExceptionHandler.class);
@ExceptionHandler(value = {
ApplicationException.class,
ServiceException.class
})
protected ResponseEntity<Object> handleExceptions(Exception ex) throws ServiceException {
logger.error("Rest Exception!", ex);
LOGGER.error("Rest Exception!", ex);
ex.printStackTrace();
if (ex.getMessage() != null) {
LOGGER.debug("Rest Exception for {}", ex.getMessage());
LOGGER.info("Rest Exception for {]", ex.getMessage());
}
if (ex instanceof ApplicationException) {
ex.printStackTrace();
return handleApplicationException((ApplicationException) ex);
......
......@@ -254,7 +254,7 @@ public class CellTemplateServiceImpl extends AbstractService {
private String getFormulaDataSource(String formula, List<String> keyValueConfigIds) {
FormulaConfigExample example = new FormulaConfigExample();
example.setOrderByClause("LENGTH(FormulaName) desc");
example.setOrderByClause("LENGTH(FORMULA_NAME) desc");
List<FormulaConfig> dataSourceList = formulaConfigMapper.selectByExample(example);
List<String> nameList = new ArrayList<>();
FormulaHelper formulaHelper = new FormulaHelper();
......@@ -270,7 +270,7 @@ public class CellTemplateServiceImpl extends AbstractService {
String keyValueMethodName = "KEYVALUE(";
if (tmpFormula.contains(keyValueMethodName)) {
KeyValueConfigExample keyValueConfigExample = new KeyValueConfigExample();
keyValueConfigExample.setOrderByClause("LENGTH(KeyCode) desc");
keyValueConfigExample.setOrderByClause("LENGTH(KEY_CODE) desc");
List<KeyValueConfig> keyValueList = keyValueConfigMapper.selectByExample(keyValueConfigExample);
for (KeyValueConfig keyValueConfig : keyValueList) {
if (tmpFormula.contains(keyValueMethodName + "\"" + keyValueConfig.getKeyCode().toUpperCase() + "\")")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment