Skip to content

Commit

Permalink
Feat: 에러함수 수정
Browse files Browse the repository at this point in the history
error.code로 에러를 판단하게 바꿨습니다.
  • Loading branch information
mututu17 committed May 2, 2024
1 parent c4c5b81 commit 738bb00
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
36 changes: 17 additions & 19 deletions client/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions client/front/lib/sign_up.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ class _SignUpScreenState extends State<SignUpScreen> {
else {
Map<String, dynamic> json = jsonDecode(response.body);
Error error = Error.fromJson(json);
if(response.statusCode == 400)
if(error.code == "DUPLICATE_DATA")
{
print(error.httpStatus+'\n');
print(error.message+'\n');
print(error.code+'\n');
showDialog(
context: context,
builder: (BuildContext context) {
Expand All @@ -81,11 +78,8 @@ class _SignUpScreenState extends State<SignUpScreen> {
},
);
}
else if(response.statusCode == 415)
else if(error.code == "INVALID_FORMAT")
{
print(error.httpStatus+'\n');
print(error.message+'\n');
print(error.code+'\n');
showDialog(
context: context,
builder: (BuildContext context) {
Expand Down

0 comments on commit 738bb00

Please sign in to comment.