Add logging for user login process in handleLogin function to improve debugging and error tracking.
This commit is contained in:
@@ -337,6 +337,7 @@ void App::populateCountryComboBox(Wt::WComboBox* countryWidget) {
|
||||
void App::handleLogin(Wt::WLineEdit* userName, Wt::WComboBox* countryWidget, Wt::WSpinBox *ageWidget, Wt::WComboBox *genderWidget) {
|
||||
try {
|
||||
std::string nick = extractTrimmedUserName(userName);
|
||||
std::cout << "handleLogin() nick='" << nick << "'" << std::endl;
|
||||
validateName(nick);
|
||||
validateGender(genderWidget);
|
||||
validateAge(ageWidget);
|
||||
@@ -345,6 +346,7 @@ void App::handleLogin(Wt::WLineEdit* userName, Wt::WComboBox* countryWidget, Wt:
|
||||
startChat();
|
||||
setCookie("wtd", sessionId(), 21000);
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << "handleLogin() exception: " << e.what() << std::endl;
|
||||
Wt::WMessageBox::show("Attention", e.what(), Wt::StandardButton::Ok);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user