From b88294238340cc45d462bbdf3292a8f53e19e064 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Sun, 24 Jan 2016 11:48:40 +0100 Subject: [PATCH] SlackUserRegistration: show raw data when team domain cannot be found in the response --- include/transport/HTTPRequest.h | 3 +++ spectrum/src/frontends/slack/SlackUserRegistration.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/transport/HTTPRequest.h b/include/transport/HTTPRequest.h index 313dff2b..f655a626 100644 --- a/include/transport/HTTPRequest.h +++ b/include/transport/HTTPRequest.h @@ -32,6 +32,9 @@ class HTTPRequest : public Thread { bool execute(); bool execute(rapidjson::Document &json); std::string getError() {return std::string(curl_errorbuffer);} + const std::string &getRawData() { + return m_data; + } void run(); void finalize(); diff --git a/spectrum/src/frontends/slack/SlackUserRegistration.cpp b/spectrum/src/frontends/slack/SlackUserRegistration.cpp index 007c259c..3b06e36b 100644 --- a/spectrum/src/frontends/slack/SlackUserRegistration.cpp +++ b/spectrum/src/frontends/slack/SlackUserRegistration.cpp @@ -90,12 +90,14 @@ std::string SlackUserRegistration::getTeamDomain(const std::string &token) { rapidjson::Value &team = resp["team"]; if (!team.IsObject()) { LOG4CXX_ERROR(logger, "No 'team' object in the reply."); + LOG4CXX_ERROR(logger, req.getRawData()); return ""; } rapidjson::Value &domain = team["domain"]; if (!domain.IsString()) { LOG4CXX_ERROR(logger, "No 'domain' string in the reply."); + LOG4CXX_ERROR(logger, req.getRawData()); return ""; }