Give different error message if family view unlock failed for rate-limit

This commit is contained in:
Alexander Corn 2017-03-04 22:30:25 -05:00
parent 758b749487
commit aca375d9da

View File

@ -281,13 +281,25 @@ SteamCommunity.prototype.parentalUnlock = function(pin, callback) {
return;
}
if(!body || typeof body.success !== 'boolean') {
if (!body || typeof body.success !== 'boolean') {
callback("Invalid response");
return;
}
if(!body.success) {
callback("Incorrect PIN");
if (!body.success) {
switch (body.eresult) {
case 15:
callback("Incorrect PIN");
break;
case 25:
callback("Too many invalid PIN attempts");
break;
default:
callback("Error " + body.eresult);
}
return;
}