summaryrefslogtreecommitdiff
path: root/indra/newview/llfacebookconnect.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-06-10 16:01:41 -0700
committerMerov Linden <merov@lindenlab.com>2013-06-10 16:01:41 -0700
commite3f093a87157c012ab4e9d378cc26876b7b91900 (patch)
tree56baa3aef93ef0582a8cea0a41fe04ee7c88cf87 /indra/newview/llfacebookconnect.cpp
parente110d87a63cfb4c50fe60930eb6cfcaa1b3d41b8 (diff)
ACME-464, ACME-509 : Skip 302 error when prompting the user for errors
Diffstat (limited to 'indra/newview/llfacebookconnect.cpp')
-rw-r--r--indra/newview/llfacebookconnect.cpp49
1 files changed, 22 insertions, 27 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 1986814815..348e2c2e90 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -36,6 +36,21 @@
#include "llnotificationsutil.h"
#include "llurlaction.h"
+
+// Local function
+void prompt_user_for_error(U32 status, const std::string& reason)
+{
+ // Note: 302 (redirect) is *not* an error that warrants prompting the user
+ if (status != 302)
+ {
+ LLSD args(LLSD::emptyMap());
+ std::stringstream msg;
+ msg << reason << " (Code " << status << ")";
+ args["FAIL_REASON"] = msg.str();
+ LLNotificationsUtil::add("FacebookCannotConnect",args);
+ }
+}
+
///////////////////////////////////////////////////////////////////////////////
//
@@ -81,12 +96,8 @@ public:
}
else
{
- LLSD args(LLSD::emptyMap());
- std::stringstream msg;
- msg << reason << " (Code " << status << ")";
- args["FAIL_REASON"] = msg.str();
- LLNotificationsUtil::add("FacebookCannotConnect",args);
- LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
+ prompt_user_for_error(status,reason);
+ LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
}
}
@@ -115,12 +126,8 @@ public:
}
else
{
- LLSD args(LLSD::emptyMap());
- std::stringstream msg;
- msg << reason << " (Code " << status << ")";
- args["FAIL_REASON"] = msg.str();
- LLNotificationsUtil::add("FacebookCannotConnect",args);
- LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL;
+ prompt_user_for_error(status,reason);
+ LL_WARNS("FacebookConnect") << "Failed to get a post response. reason: " << reason << " status: " << status << LL_ENDL;
}
}
@@ -153,11 +160,7 @@ public:
}
else
{
- LLSD args(LLSD::emptyMap());
- std::stringstream msg;
- msg << reason << " (Code " << status << ")";
- args["FAIL_REASON"] = msg.str();
- LLNotificationsUtil::add("FacebookCannotConnect",args);
+ prompt_user_for_error(status,reason);
LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
}
}
@@ -193,11 +196,7 @@ public:
}
else
{
- LLSD args(LLSD::emptyMap());
- std::stringstream msg;
- msg << reason << " (Code " << status << ")";
- args["FAIL_REASON"] = msg.str();
- LLNotificationsUtil::add("FacebookCannotConnect",args);
+ prompt_user_for_error(status,reason);
}
}
}
@@ -222,11 +221,7 @@ public:
}
else
{
- LLSD args(LLSD::emptyMap());
- std::stringstream msg;
- msg << reason << " (Code " << status << ")";
- args["FAIL_REASON"] = msg.str();
- LLNotificationsUtil::add("FacebookCannotConnect",args);
+ prompt_user_for_error(status,reason);
LL_WARNS("FacebookConnect") << "Failed to get a response. reason: " << reason << " status: " << status << LL_ENDL;
}
}