aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2023-03-05 15:00:35 -0500
committerpg9182 <96569817+pg9182@users.noreply.github.com>2023-04-17 14:53:23 -0400
commit009482fcb88873ad6d781394c6a89a9a9a62fbd0 (patch)
tree9011a09604192c7955f9b5b09e1a2487e4cf0c92
parentb1aed577e4a92d41f22464936e7236b6a30ffb90 (diff)
downloadNorthstarLauncher-009482fcb88873ad6d781394c6a89a9a9a62fbd0.tar.gz
NorthstarLauncher-009482fcb88873ad6d781394c6a89a9a9a62fbd0.zip
Use detailed master server error messages when available
The error.msg field has always been around, but we never used it.
-rw-r--r--NorthstarDLL/masterserver/masterserver.cpp8
1 files changed, 6 insertions, 2 deletions
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";