diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/poco/Foundation/src/Bugcheck.cpp | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/poco/Foundation/src/Bugcheck.cpp')
-rw-r--r-- | contrib/libs/poco/Foundation/src/Bugcheck.cpp | 238 |
1 files changed, 119 insertions, 119 deletions
diff --git a/contrib/libs/poco/Foundation/src/Bugcheck.cpp b/contrib/libs/poco/Foundation/src/Bugcheck.cpp index 14f5170c84..7b8df68c92 100644 --- a/contrib/libs/poco/Foundation/src/Bugcheck.cpp +++ b/contrib/libs/poco/Foundation/src/Bugcheck.cpp @@ -1,119 +1,119 @@ -// -// Bugcheck.cpp -// -// Library: Foundation -// Package: Core -// Module: Bugcheck -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Bugcheck.h" -#include "Poco/Debugger.h" -#include "Poco/Exception.h" -#include <sstream> - - -namespace Poco { - - -void Bugcheck::assertion(const char* cond, const char* file, int line, const char* text) -{ - std::string message("Assertion violation: "); - message += cond; - if (text) - { - message += " ("; - message += text; - message += ")"; - } - Debugger::enter(message, file, line); - throw AssertionViolationException(what(cond, file, line, text)); -} - - -void Bugcheck::nullPointer(const char* ptr, const char* file, int line) -{ - Debugger::enter(std::string("NULL pointer: ") + ptr, file, line); - throw NullPointerException(what(ptr, file, line)); -} - - -void Bugcheck::bugcheck(const char* file, int line) -{ - Debugger::enter("Bugcheck", file, line); - throw BugcheckException(what(0, file, line)); -} - - -void Bugcheck::bugcheck(const char* msg, const char* file, int line) -{ - std::string m("Bugcheck"); - if (msg) - { - m.append(": "); - m.append(msg); - } - Debugger::enter(m, file, line); - throw BugcheckException(what(msg, file, line)); -} - - -void Bugcheck::unexpected(const char* file, int line) -{ -#ifdef _DEBUG - try - { - std::string msg("Unexpected exception in noexcept function or destructor: "); - try - { - throw; - } - catch (Poco::Exception& exc) - { - msg += exc.displayText(); - } - catch (std::exception& exc) - { - msg += exc.what(); - } - catch (...) - { - msg += "unknown exception"; - } - Debugger::enter(msg, file, line); - } - catch (...) - { - } -#endif -} - - -void Bugcheck::debugger(const char* file, int line) -{ - Debugger::enter(file, line); -} - - -void Bugcheck::debugger(const char* msg, const char* file, int line) -{ - Debugger::enter(msg, file, line); -} - - -std::string Bugcheck::what(const char* msg, const char* file, int line, const char* text) -{ - std::ostringstream str; - if (msg) str << msg << " "; - if (text != NULL) str << "(" << text << ") "; - str << "in file \"" << file << "\", line " << line; - return str.str(); -} - - -} // namespace Poco +// +// Bugcheck.cpp +// +// Library: Foundation +// Package: Core +// Module: Bugcheck +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/Bugcheck.h" +#include "Poco/Debugger.h" +#include "Poco/Exception.h" +#include <sstream> + + +namespace Poco { + + +void Bugcheck::assertion(const char* cond, const char* file, int line, const char* text) +{ + std::string message("Assertion violation: "); + message += cond; + if (text) + { + message += " ("; + message += text; + message += ")"; + } + Debugger::enter(message, file, line); + throw AssertionViolationException(what(cond, file, line, text)); +} + + +void Bugcheck::nullPointer(const char* ptr, const char* file, int line) +{ + Debugger::enter(std::string("NULL pointer: ") + ptr, file, line); + throw NullPointerException(what(ptr, file, line)); +} + + +void Bugcheck::bugcheck(const char* file, int line) +{ + Debugger::enter("Bugcheck", file, line); + throw BugcheckException(what(0, file, line)); +} + + +void Bugcheck::bugcheck(const char* msg, const char* file, int line) +{ + std::string m("Bugcheck"); + if (msg) + { + m.append(": "); + m.append(msg); + } + Debugger::enter(m, file, line); + throw BugcheckException(what(msg, file, line)); +} + + +void Bugcheck::unexpected(const char* file, int line) +{ +#ifdef _DEBUG + try + { + std::string msg("Unexpected exception in noexcept function or destructor: "); + try + { + throw; + } + catch (Poco::Exception& exc) + { + msg += exc.displayText(); + } + catch (std::exception& exc) + { + msg += exc.what(); + } + catch (...) + { + msg += "unknown exception"; + } + Debugger::enter(msg, file, line); + } + catch (...) + { + } +#endif +} + + +void Bugcheck::debugger(const char* file, int line) +{ + Debugger::enter(file, line); +} + + +void Bugcheck::debugger(const char* msg, const char* file, int line) +{ + Debugger::enter(msg, file, line); +} + + +std::string Bugcheck::what(const char* msg, const char* file, int line, const char* text) +{ + std::ostringstream str; + if (msg) str << msg << " "; + if (text != NULL) str << "(" << text << ") "; + str << "in file \"" << file << "\", line " << line; + return str.str(); +} + + +} // namespace Poco |