From 009482fcb88873ad6d781394c6a89a9a9a62fbd0 Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Sun, 5 Mar 2023 15:00:35 -0500 Subject: Use detailed master server error messages when available The error.msg field has always been around, but we never used it. --- NorthstarDLL/masterserver/masterserver.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'NorthstarDLL/masterserver') diff --git a/NorthstarDLL/masterserver/masterserver.cpp b/NorthstarDLL/masterserver/masterserver.cpp index c71be961..76106169 100644 --- a/NorthstarDLL/masterserver/masterserver.cpp +++ b/NorthstarDLL/masterserver/masterserver.cpp @@ -498,7 +498,9 @@ void MasterServerManager::AuthenticateWithOwnServer(const char* uid, const char* spdlog::error("Failed reading masterserver response: got fastify error response"); spdlog::error(readBuffer); - if (authInfoJson["error"].HasMember("enum")) + if (authInfoJson["error"].HasMember("msg")) + m_sAuthFailureReason = authInfoJson["error"]["msg"].GetString(); + else if (authInfoJson["error"].HasMember("enum")) m_sAuthFailureReason = authInfoJson["error"]["enum"].GetString(); else m_sAuthFailureReason = "No error message provided"; @@ -651,7 +653,9 @@ void MasterServerManager::AuthenticateWithServer(const char* uid, const char* pl spdlog::error("Failed reading masterserver response: got fastify error response"); spdlog::error(readBuffer); - if (connectionInfoJson["error"].HasMember("enum")) + if (connectionInfoJson["error"].HasMember("msg")) + m_sAuthFailureReason = connectionInfoJson["error"]["msg"].GetString(); + else if (connectionInfoJson["error"].HasMember("enum")) m_sAuthFailureReason = connectionInfoJson["error"]["enum"].GetString(); else m_sAuthFailureReason = "No error message provided"; -- cgit v1.2.3