Open jongeuni opened 2 years ago
{
"errors": [
{
"message": "Exception while fetching data (/createAccount) : email already exist",
"locations": [
{
"line": 2,
"column": 5
}
],
"path": [
"createAccount"
],
"extensions": {
"code": 400,
"message": "email already exist",
"classification": "DataFetchingException"
}
}
],
"data": {
"createAccount": null
}
}
ํ์ฌ ์ด๋ฐ ์์ผ๋ก ์๋ต์ด ์จ๋ค. ์์ ์ ์๋ ๊ฒ์ฒ๋ผ Response Status๋ฅผ ๋ฐ๊ฟ ์ ์์ผ๋ฉด ์ข๊ฒ ์ง๋ง ๊ธ๋ค์ ๋ณด์์ ๋ 200OK๋ง ์ฌ์ฉํ๋ ๊ฒ ๊ฐ๋ค.
{
"status": 400,
"message": "password mismatch",
}
์๋ ์ด๋ ๊ฒ๋ง ์๋ต ์ฃผ์์๋๋ฐ
{
"status": 400,
"message": "password mismatch",
"detailsMessage": "์กด์ฌํ๋ ์ด๋ฉ์ผ์ด์ง๋ง ๋น๋ฐ๋ฒํธ๊ฐ ์ฌ๋ฐ๋ฅด์ง ์์ต๋๋ค.",
"stack": "Optional[com.dsm.spotemo.rest.LoginService.login(LoginService.java:23)]"
}
์ด๋ฐ์์ผ๋ก ๋ณ๊ฒฝํ๋ค. stack์ ๊ฒฝ์ฐ e.getStackTrace()
์ ์ฐ์์ ๋ ๋์ค๋ ๊ธด ๋ฐฐ์ด์ ์ฒซ๋ฒ์งธ๊ฐ๋ง ๋นผ๋๋ค.
Exception Handling in GraphQL
Exception Handling in Login (Rest api)