mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 03:42:48 +00:00
28 lines
641 B
C++
28 lines
641 B
C++
#include <Common/ShellCommandSettings.h>
|
|
|
|
#include <magic_enum.hpp>
|
|
#include <Poco/String.h>
|
|
#include <Common/Exception.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
namespace ErrorCodes
|
|
{
|
|
extern const int BAD_ARGUMENTS;
|
|
}
|
|
|
|
ExternalCommandStderrReaction parseExternalCommandStderrReaction(const std::string & config)
|
|
{
|
|
auto reaction = magic_enum::enum_cast<ExternalCommandStderrReaction>(Poco::toUpper(config));
|
|
if (!reaction)
|
|
throw Exception(
|
|
ErrorCodes::BAD_ARGUMENTS,
|
|
"Unknown stderr_reaction: {}. Possible values are 'none', 'log', 'log_first', 'log_last' and 'throw'",
|
|
config);
|
|
|
|
return *reaction;
|
|
}
|
|
|
|
}
|