오윤석

Merge branch 'develop' into feature/3-readme

......@@ -119,6 +119,10 @@ const getCharacterInfo = async function(nickname, characterCode) {
}
});
if (stats.major == 0) {
throw new Error("no_major_stats")
}
return {
character: character,
stats: stats
......@@ -129,6 +133,8 @@ const getCharacterInfo = async function(nickname, characterCode) {
return -1;
else if (error.message == "game_checking")
return -2;
else if (error.message == "no_major_stats")
return -3;
else
return -999;
}
......
......@@ -28,6 +28,10 @@ module.exports = {
// 점검중
res.status(503).send();
return;
} else if (characterInfo == -3) {
// 데이터를 받아오지 못함
res.status(502).send();
return;
} else if (characterInfo < 0) {
res.status(400).send();
return;
......@@ -64,6 +68,12 @@ module.exports = {
}
};
if (result.analysis.default.stats.major.pure == null) {
// 데이터를 받아오지 못해 분석 실패
res.status(502).send();
return;
}
console.log(JSON.stringify(result));
res.send(result);
}
......
......@@ -113,6 +113,10 @@
}
}).then(function(response) {
character = response.data;
if(character.analysis.default.stats.major.pure == null) {
M.toast({html:"메이플스토리로부터 데이터를 받아오지 못했습니다.<br><br>잠시 후에 시도해주세요."});
push('/');
}
isCharacterLoading = true;
}).catch(function(error) {
switch(error.response.status) {
......@@ -125,6 +129,9 @@
window.open("https://maplestory.nexon.com/MyMaple/Account/Character/Visibility");
}, 2000);
break;
case 502:
M.toast({html:"메이플스토리로부터 데이터를 받아오지 못했습니다.<br><br>잠시 후에 시도해주세요."});
break;
case 503:
M.toast({html:"메이플스토리가 점검중입니다."});
break;
......