VirLinden avatar VirLinden committed 0af1a0f

SH-1773 FIX

Comments (0)

Files changed (1)

indra/newview/llmeshrepository.cpp

 
 };
 
-void log_upload_error(const LLSD& content,std::string stage)
+void log_upload_error(S32 status, const LLSD& content,std::string stage)
 {
+	llwarns << "stage: " << stage << " http status: " << status << llendl;
 	if (content.has("error"))
 	{
 		const LLSD& err = content["error"];
-		llwarns << "mesh upload failed, stage " << stage
-				<< " message " << err["message"].asString() << " id " << err["identifier"].asString()
-				<< llendl;
-
-		if (content.has("errors"))
+		llwarns << "err: " << err << llendl;
+		llwarns << "mesh upload failed, stage '" << stage
+				<< "' error '" << err["error"].asString()
+				<< "', message '" << err["message"].asString()
+				<< "', id '" << err["identifier"].asString()
+				<< "'" << llendl;
+		if (err.has("errors"))
 		{
-			const LLSD& err_list = content["errors"];
+			S32 error_num = 0;
+			const LLSD& err_list = err["errors"];
 			for (LLSD::array_const_iterator it = err_list.beginArray();
 				 it != err_list.endArray();
 				 ++it)
 			{
 				const LLSD& err_entry = *it;
-				std::string index_info;
-				std::string texture_index_str = err_entry["TextureIndex"].asString();
-				if (!texture_index_str.empty())
+				llwarns << "error[" << error_num << "]:" << llendl;
+				for (LLSD::map_const_iterator map_it = err_entry.beginMap();
+					 map_it != err_entry.endMap();
+					 ++map_it)
 				{
-					index_info += " texture_index: " + texture_index_str;
+					llwarns << "\t" << map_it->first << ": "
+							<< map_it->second << llendl;
 				}
-				std::string	mesh_index_str = err_entry["MeshIndex"].asString();
-				if (!mesh_index_str.empty())
-				{
-					index_info += " mesh_index: " + mesh_index_str;
-				}
-				llwarns << "mesh err code " << err_entry["error"].asString()
-						<< " message " << err_entry["message"]
-						<< index_info
-						<< llendl;
+				error_num++;
 			}
 		}
 	}
 	{
 		llwarns << "bad mesh, no error information available" << llendl;
 	}
-
-	
 }
 
 class LLModelObjectUploadResponder: public LLCurl::Responder
 						   const std::string& reason,
 						   const LLSD& content)
 	{
-		//assert_main_thread();
 		llinfos << "completed" << llendl;
 		mThread->mPendingUploads--;
 		dumpLLSDToFile(content,make_dump_name("whole_model_fee_response_",dump_num));
-		llinfos << "LLWholeModelFeeResponder content: " << content << llendl;
-		if (isGoodStatus(status))
+		if (isGoodStatus(status) &&
+			content["state"].asString() == "upload")
 		{
 			llinfos << "fee request succeeded" << llendl;
 			mThread->mWholeModelUploadURL = content["uploader"].asString(); 
 		else
 		{
 			llwarns << "fee request failed" << llendl;
-			log_upload_error(content,"fee");
+			log_upload_error(status,content,"fee");
 			mThread->mWholeModelUploadURL = "";
 		}
 	}
 		llinfos << "LLWholeModelUploadResponder content: " << content << llendl;
 		// requested "mesh" asset type isn't actually the type
 		// of the resultant object, fix it up here.
-		if (isGoodStatus(status))
+		if (isGoodStatus(status) &&
+			content["state"].asString() == "complete")
 		{
 			llinfos << "upload succeeded" << llendl;
 			mPostData["asset_type"] = "object";
 		else
 		{
 			llwarns << "upload failed" << llendl;
-			log_upload_error(content,"upload");
+			log_upload_error(status,content,"upload");
 		}
 	}
 };
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.