diff options
Diffstat (limited to 'source/core/StarException_windows.cpp')
-rw-r--r-- | source/core/StarException_windows.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/core/StarException_windows.cpp b/source/core/StarException_windows.cpp index 8892eb2..ca81332 100644 --- a/source/core/StarException_windows.cpp +++ b/source/core/StarException_windows.cpp @@ -145,7 +145,7 @@ StarException::StarException() noexcept : StarException(std::string("StarExcepti StarException::~StarException() noexcept {} -StarException::StarException(std::string message) noexcept : StarException("StarException", move(message)) {} +StarException::StarException(std::string message, bool genStackTrace) noexcept : StarException("StarException", move(message), genStackTrace) {} StarException::StarException(std::exception const& cause) noexcept : StarException("StarException", std::string(), cause) {} @@ -162,20 +162,20 @@ const char* StarException::what() const throw() { return m_whatBuffer.c_str(); } -StarException::StarException(char const* type, std::string message) noexcept { +StarException::StarException(char const* type, std::string message, bool genStackTrace) noexcept { auto printException = []( - std::ostream& os, bool fullStacktrace, char const* type, std::string message, StackCapture stack) { + std::ostream& os, bool fullStacktrace, char const* type, std::string message, Maybe<StackCapture> stack) { os << "(" << type << ")"; if (!message.empty()) os << " " << message; - if (fullStacktrace) { + if (fullStacktrace && stack) { os << std::endl; - os << outputStack(stack); + os << outputStack(*stack); } }; - m_printException = bind(printException, _1, _2, type, move(message), captureStack()); + m_printException = bind(printException, _1, _2, type, move(message), genStackTrace ? captureStack() : Maybe<StackCapture>()); } StarException::StarException(char const* type, std::string message, std::exception const& cause) noexcept |