- api 요청 오류시 400에러를 리턴하도록 수정
| | |
| | | |
| | | import kr.wisestone.owl.constant.Constants; |
| | | import kr.wisestone.owl.domain.Issue; |
| | | import kr.wisestone.owl.exception.OwlRuntimeException; |
| | | import kr.wisestone.owl.service.GuideService; |
| | | import kr.wisestone.owl.service.IssueService; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.Stack; |
| | | |
| | | @Controller |
| | | public class ApiController extends BaseController { |
| | |
| | | @RequestMapping(value = "api/issue", method = RequestMethod.POST) |
| | | public |
| | | @ResponseBody |
| | | Map<String, Object> addIssue(MultipartHttpServletRequest request) throws Exception { |
| | | Map<String, Object> addIssue(MultipartHttpServletRequest request) throws OwlRuntimeException { |
| | | Map<String, Object> resJsonData = new HashMap<>(); |
| | | |
| | | IssueApiForm issueForm = IssueApiForm.make(ConvertUtil.convertJsonToMap(request.getParameter(Constants.REQ_KEY_CONTENT)), request.getFiles("file")); |
| | |
| | | Map<String, Object> resJsonData = new HashMap<String, Object>(); |
| | | resJsonData.put(Constants.RES_KEY_MESSAGE, this.messageAccessor.getResMessage(ex, Constants.RES_KEY_MSG_FAIL)); |
| | | |
| | | return this.handleExceptionInternal(ex, resJsonData, new HttpHeaders(), HttpStatus.OK, request); |
| | | return this.handleExceptionInternal(ex, resJsonData, new HttpHeaders(), HttpStatus.BAD_REQUEST, request); |
| | | } |
| | | |
| | | @ExceptionHandler({ StackOverflowError.class, |