Skip to content

Commit

Permalink
fix: Exception handling in GUI main
Browse files Browse the repository at this point in the history
  • Loading branch information
vasylskorych committed Jul 11, 2024
1 parent 5b7db60 commit d20dbd1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions DyssolMainWindow/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
* All rights reserved. This file is part of Dyssol. See LICENSE file for license information. */

#include "Dyssol.h"
#include "FileSystem.h"

#ifdef _WIN32
#ifdef _MSC_VER
// Print message to the VS Output window.
void VSDebugOutput(const std::string_view _message)
void VSDebugOutput(const std::string& _message)
{
std::ostringstream os;
os << _message;
OutputDebugStringA(os.str().c_str());
OutputDebugStringA(_message.c_str());
}
#endif

Expand All @@ -26,7 +23,7 @@ void HandleException(const std::exception_ptr& _exceptionPtr)
{
const std::string message = "Unknown unhandled exception caught: '" + std::string{ e.what() } + "'\n";
std::cout << message;
#ifdef _WIN32
#ifdef _MSC_VER
VSDebugOutput(message);
#endif
}
Expand Down

0 comments on commit d20dbd1

Please sign in to comment.