mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2026-08-24 23:53:28 +08:00
Compare commits
4 Commits
v3.19.0-be
...
v3.19.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
893c4df06b | ||
|
|
593ed6b9ef | ||
|
|
840e9548ed | ||
|
|
dee6b7964b |
@@ -97,9 +97,17 @@ SteamCommunity.prototype._checkHttpError = function(err, response, callback) {
|
||||
};
|
||||
|
||||
SteamCommunity.prototype._checkCommunityError = function(html, callback) {
|
||||
if(html.match(/<h1>Sorry!<\/h1>/)) {
|
||||
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;
|
||||
}
|
||||
@@ -108,6 +116,10 @@ SteamCommunity.prototype._checkCommunityError = function(html, callback) {
|
||||
};
|
||||
|
||||
SteamCommunity.prototype._checkTradeError = function(html, callback) {
|
||||
if (!html) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var match = html.match(/<div id="error_msg">\s*([^<]+)\s*<\/div>/);
|
||||
if (match) {
|
||||
var err = new Error(match[1].trim());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "steamcommunity",
|
||||
"version": "3.19.0-beta4",
|
||||
"version": "3.19.0-beta6",
|
||||
"description": "Provides an interface for logging into and interacting with the Steam Community website",
|
||||
"keywords": ["steam", "steam community"],
|
||||
"homepage": "https://github.com/DoctorMcKay/node-steamcommunity",
|
||||
|
||||
Reference in New Issue
Block a user