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/ErrorHandler.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/ErrorHandler.cpp')
-rw-r--r-- | contrib/libs/poco/Foundation/src/ErrorHandler.cpp | 228 |
1 files changed, 114 insertions, 114 deletions
diff --git a/contrib/libs/poco/Foundation/src/ErrorHandler.cpp b/contrib/libs/poco/Foundation/src/ErrorHandler.cpp index d0af8ea8a1..582565dc3f 100644 --- a/contrib/libs/poco/Foundation/src/ErrorHandler.cpp +++ b/contrib/libs/poco/Foundation/src/ErrorHandler.cpp @@ -1,114 +1,114 @@ -// -// ErrorHandler.cpp -// -// Library: Foundation -// Package: Threading -// Module: ErrorHandler -// -// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/ErrorHandler.h" -#include "Poco/SingletonHolder.h" - - -namespace Poco { - - -ErrorHandler* ErrorHandler::_pHandler = ErrorHandler::defaultHandler(); -FastMutex ErrorHandler::_mutex; - - -ErrorHandler::ErrorHandler() -{ -} - - -ErrorHandler::~ErrorHandler() -{ -} - - -void ErrorHandler::exception(const Exception& exc) -{ - poco_debugger_msg(exc.what()); -} - - -void ErrorHandler::exception(const std::exception& exc) -{ - poco_debugger_msg(exc.what()); -} - - -void ErrorHandler::exception() -{ - poco_debugger_msg("unknown exception"); -} - - -void ErrorHandler::handle(const Exception& exc) -{ - FastMutex::ScopedLock lock(_mutex); - try - { - _pHandler->exception(exc); - } - catch (...) - { - } -} - - -void ErrorHandler::handle(const std::exception& exc) -{ - FastMutex::ScopedLock lock(_mutex); - try - { - _pHandler->exception(exc); - } - catch (...) - { - } -} - - -void ErrorHandler::handle() -{ - FastMutex::ScopedLock lock(_mutex); - try - { - _pHandler->exception(); - } - catch (...) - { - } -} - - -ErrorHandler* ErrorHandler::set(ErrorHandler* pHandler) -{ - poco_check_ptr(pHandler); - - FastMutex::ScopedLock lock(_mutex); - ErrorHandler* pOld = _pHandler; - _pHandler = pHandler; - return pOld; -} - - -ErrorHandler* ErrorHandler::defaultHandler() -{ - // NOTE: Since this is called to initialize the static _pHandler - // variable, sh has to be a local static, otherwise we run - // into static initialization order issues. - static SingletonHolder<ErrorHandler> sh; - return sh.get(); -} - - -} // namespace Poco +// +// ErrorHandler.cpp +// +// Library: Foundation +// Package: Threading +// Module: ErrorHandler +// +// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/ErrorHandler.h" +#include "Poco/SingletonHolder.h" + + +namespace Poco { + + +ErrorHandler* ErrorHandler::_pHandler = ErrorHandler::defaultHandler(); +FastMutex ErrorHandler::_mutex; + + +ErrorHandler::ErrorHandler() +{ +} + + +ErrorHandler::~ErrorHandler() +{ +} + + +void ErrorHandler::exception(const Exception& exc) +{ + poco_debugger_msg(exc.what()); +} + + +void ErrorHandler::exception(const std::exception& exc) +{ + poco_debugger_msg(exc.what()); +} + + +void ErrorHandler::exception() +{ + poco_debugger_msg("unknown exception"); +} + + +void ErrorHandler::handle(const Exception& exc) +{ + FastMutex::ScopedLock lock(_mutex); + try + { + _pHandler->exception(exc); + } + catch (...) + { + } +} + + +void ErrorHandler::handle(const std::exception& exc) +{ + FastMutex::ScopedLock lock(_mutex); + try + { + _pHandler->exception(exc); + } + catch (...) + { + } +} + + +void ErrorHandler::handle() +{ + FastMutex::ScopedLock lock(_mutex); + try + { + _pHandler->exception(); + } + catch (...) + { + } +} + + +ErrorHandler* ErrorHandler::set(ErrorHandler* pHandler) +{ + poco_check_ptr(pHandler); + + FastMutex::ScopedLock lock(_mutex); + ErrorHandler* pOld = _pHandler; + _pHandler = pHandler; + return pOld; +} + + +ErrorHandler* ErrorHandler::defaultHandler() +{ + // NOTE: Since this is called to initialize the static _pHandler + // variable, sh has to be a local static, otherwise we run + // into static initialization order issues. + static SingletonHolder<ErrorHandler> sh; + return sh.get(); +} + + +} // namespace Poco |