Skip to content

Commit

Permalink
[FIX] JSONException 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
ckkim817 committed Jul 24, 2024
1 parent d509723 commit 9b7b606
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public Exception decode(String methodKey, Response response) {

// 응답결과 JSON 파싱
JSONObject jsonObject = new JSONObject(body);
String message = jsonObject.getString("message");
String message = jsonObject.optString("message", "Unknown error");

// 응답 메시지를 기준으로 분기처리
if (message.equals("대학과 일치하지 않는 메일 도메인입니다.")) {
throw new CustomException(ErrorType.INVALID_EMAIL_DOMAIN_ERROR);
Expand Down

0 comments on commit 9b7b606

Please sign in to comment.