mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-03-26 23:50:10 +08:00
Detect when we aren't logged in and should be
This commit is contained in:
parent
840e9548ed
commit
593ed6b9ef
@ -97,9 +97,17 @@ SteamCommunity.prototype._checkHttpError = function(err, response, callback) {
|
||||
};
|
||||
|
||||
SteamCommunity.prototype._checkCommunityError = function(html, callback) {
|
||||
var err;
|
||||
|
||||
if(html && html.match(/<h1>Sorry!<\/h1>/)) {
|
||||
var match = html.match(/<h3>(.+)<\/h3>/);
|
||||
var err = new Error(match ? match[1] : "Unknown error occurred");
|
||||
err = new Error(match ? match[1] : "Unknown error occurred");
|
||||
callback(err);
|
||||
return err;
|
||||
}
|
||||
|
||||
if (html && html.match(/g_steamID = false;/) && html.match(/<h1>Sign In<\/h1>/)) {
|
||||
err = new Error("Not Logged In");
|
||||
callback(err);
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user