Explorar o código

UI: Log YouTube API HTTP request errors

derrod %!s(int64=3) %!d(string=hai) anos
pai
achega
eb62162d50
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      UI/youtube-api-wrappers.cpp

+ 6 - 1
UI/youtube-api-wrappers.cpp

@@ -84,8 +84,13 @@ bool YoutubeApiWrappers::TryInsertCommand(const char *url,
 	if (error_code)
 		*error_code = httpStatusCode;
 
-	if (!success || output.empty())
+	if (!success || output.empty()) {
+		if (!error.empty())
+			blog(LOG_WARNING, "YouTube API request failed: %s",
+			     error.c_str());
 		return false;
+	}
+
 	json_out = Json::parse(output, error);
 #ifdef _DEBUG
 	blog(LOG_DEBUG, "YouTube API command answer: %s",