Search in sources :

Example 31 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class GlobalExceptionHandler method noHandlerFoundExceptionHandler.

/**
 * @Method Name  : noHandlerFoundExceptionHandler
 * @Method 설명 : 404
 * @작성자   : ytkim
 * @작성일   : 2019. 11. 29.
 * @변경이력  :
 * @param request
 * @param ex
 * @return
 */
@ExceptionHandler(NoHandlerFoundException.class)
public void noHandlerFoundExceptionHandler(NoHandlerFoundException ex, HttpServletRequest request, HttpServletResponse response) {
    ResponseResult result = new ResponseResult();
    result.setMessage(ex.getMessage());
    exceptionRequestHandle(ex, request, response, result, "error404");
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) ExceptionHandler(org.springframework.web.bind.annotation.ExceptionHandler)

Example 32 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class GlobalExceptionHandler method runtimeExceptionHandler.

/**
 * @Method Name  : runtimeExceptionHandle
 * @Method 설명 : 실행시 에러 처리.
 * @작성자   : ytkim
 * @작성일   : 2017. 11. 13.
 * @변경이력  :
 * @param ex
 * @param response
 * @return
 */
@ExceptionHandler(value = RuntimeException.class)
public void runtimeExceptionHandler(RuntimeException ex, HttpServletRequest request, HttpServletResponse response) {
    ResponseResult result = new ResponseResult();
    result.setMessage(ex.getMessage());
    exceptionRequestHandle(ex, request, response, result);
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) ExceptionHandler(org.springframework.web.bind.annotation.ExceptionHandler)

Example 33 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class GlobalExceptionHandler method varsqlAppExceptionHandler.

/**
 * @Method Name  : varsqlAppExceptionHandler
 * @Method 설명 : var sql error 처리.
 * @작성자   : ytkim
 * @작성일   : 2017. 11. 13.
 * @변경이력  :
 * @param ex
 * @param response
 * @return
 */
@ExceptionHandler(value = VarsqlAppException.class)
public void varsqlAppExceptionHandler(VarsqlAppException ex, HttpServletRequest request, HttpServletResponse response) {
    commonServiceImpl.insertExceptionLog("VarsqlAppException", ex);
    ResponseResult result = new ResponseResult();
    result.setResultCode(ex.getErrorCode());
    result.setMessage(ex.getMessage());
    exceptionRequestHandle(ex, request, response, result);
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) ExceptionHandler(org.springframework.web.bind.annotation.ExceptionHandler)

Example 34 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class GlobalExceptionHandler method missingServletRequestParameterExceptionHandler.

/**
 * @Method Name  : missingServletRequestParameterExceptionHandler
 * @Method 설명 : missing parameter exception
 * @작성자   : ytkim
 * @작성일   : 2019. 11. 29.
 * @변경이력  :
 * @param request
 * @param ex
 * @return
 */
@ExceptionHandler(value = MissingServletRequestParameterException.class)
public void missingServletRequestParameterExceptionHandler(Exception ex, HttpServletRequest request, HttpServletResponse response) {
    logger.error("missingServletRequestParameterExceptionHandler:{}", ex.getMessage(), ex);
    exceptionRequestHandle(ex, request, response, new ResponseResult(), "error403");
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) ExceptionHandler(org.springframework.web.bind.annotation.ExceptionHandler)

Example 35 with ResponseResult

use of com.vartech.common.app.beans.ResponseResult in project varsql by varsqlinfo.

the class GlobalExceptionHandler method connectionExceptionHandler.

/**
 * @Method Name  : connectionExceptionHandle
 * @Method 설명 : 커넥션 에러.
 * @작성자   : ytkim
 * @작성일   : 2018. 2. 13.
 * @변경이력  :
 * @param ex
 * @param request
 * @param response
 */
@ExceptionHandler(value = ConnectionException.class)
public void connectionExceptionHandler(ConnectionException ex, HttpServletRequest request, HttpServletResponse response) {
    commonServiceImpl.insertExceptionLog("connectionException", ex);
    ResponseResult result = new ResponseResult();
    exceptionRequestHandle(ex, request, response, result, "connError");
}
Also used : ResponseResult(com.vartech.common.app.beans.ResponseResult) ExceptionHandler(org.springframework.web.bind.annotation.ExceptionHandler)

Aggregations

ResponseResult (com.vartech.common.app.beans.ResponseResult)75 ExceptionHandler (org.springframework.web.bind.annotation.ExceptionHandler)15 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)14 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)13 Transactional (org.springframework.transaction.annotation.Transactional)12 MetaControlBean (com.varsql.core.db.MetaControlBean)10 DBTypeDriverProviderEntity (com.varsql.web.model.entity.db.DBTypeDriverProviderEntity)8 HashMap (java.util.HashMap)8 DBConnectionEntity (com.varsql.web.model.entity.db.DBConnectionEntity)6 EncryptDecryptException (com.vartech.common.crypto.EncryptDecryptException)6 IOException (java.io.IOException)6 ArrayList (java.util.ArrayList)6 Map (java.util.Map)6 ObjectError (org.springframework.validation.ObjectError)6 FileInfoEntity (com.varsql.web.model.entity.app.FileInfoEntity)5 SQLException (java.sql.SQLException)5 FileInfo (com.varsql.core.common.beans.FileInfo)4 JDBCDriverInfo (com.varsql.core.connection.beans.JDBCDriverInfo)4 DBMetadataException (com.varsql.core.exception.DBMetadataException)4 DBTypeDriverEntity (com.varsql.web.model.entity.db.DBTypeDriverEntity)4