From 1567e6ce078ea7dbd000c514e5eed3e8066a0bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A0=95=EB=AF=BC?= Date: Thu, 8 Aug 2024 13:05:08 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20qna=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edufocus/qna/controller/QnaController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/com/edufocus/edufocus/qna/controller/QnaController.java b/backend/src/main/java/com/edufocus/edufocus/qna/controller/QnaController.java index 6a20a67..51d816b 100644 --- a/backend/src/main/java/com/edufocus/edufocus/qna/controller/QnaController.java +++ b/backend/src/main/java/com/edufocus/edufocus/qna/controller/QnaController.java @@ -75,13 +75,13 @@ public class QnaController { if (findUser.getRole() != UserRole.ADMIN) { System.out.println("role 안맞음"); - throw new RuntimeException("update 실패"); + return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); } QnaResponseDto responseDto = qnaService.updateAnswer(qna_id, qnaRequestDto); return new ResponseEntity<>(responseDto, HttpStatus.ACCEPTED); } catch (Exception e) { - throw new RuntimeException(e); + return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); } } @@ -126,7 +126,7 @@ public class QnaController { return new ResponseEntity<>(HttpStatus.ACCEPTED); } catch (SQLException e) { - throw new RuntimeException(e); + return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); } } @@ -137,7 +137,7 @@ public class QnaController { return new ResponseEntity<>(findQna, HttpStatus.ACCEPTED); } catch (SQLException e) { - throw new RuntimeException(e); + return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); } } @@ -150,7 +150,7 @@ public class QnaController { return new ResponseEntity<>(qnaList, HttpStatus.ACCEPTED); } catch (SQLException e) { - throw new RuntimeException(e); + return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); } }