From aca375d9da2fd34f9c86ecf62a0a049fe569f200 Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Sat, 4 Mar 2017 22:30:25 -0500 Subject: [PATCH] Give different error message if family view unlock failed for rate-limit --- index.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 46a19b3..c14c091 100644 --- a/index.js +++ b/index.js @@ -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; }