#pragma once #include #include #include #include #include #include "config.h" #if USE_AWS_S3 #include #include #include #include namespace DB { namespace ErrorCodes { extern const int S3_ERROR; } struct Settings; class S3Exception : public Exception { public: // Format message with fmt::format, like the logging functions. template S3Exception(Aws::S3::S3Errors code_, fmt::format_string fmt, Args &&... args) : Exception(fmt::format(fmt, std::forward(args)...), ErrorCodes::S3_ERROR) , code(code_) { } S3Exception(const std::string & msg, Aws::S3::S3Errors code_) : Exception(msg, ErrorCodes::S3_ERROR) , code(code_) {} Aws::S3::S3Errors getS3ErrorCode() const { return code; } bool isRetryableError() const; private: Aws::S3::S3Errors code; }; } #endif namespace Poco::Util { class AbstractConfiguration; }; namespace DB { struct ProxyConfigurationResolver; namespace S3 { HTTPHeaderEntries getHTTPHeaders(const std::string & config_elem, const Poco::Util::AbstractConfiguration & config, std::string header_key = "header"); ServerSideEncryptionKMSConfig getSSEKMSConfig(const std::string & config_elem, const Poco::Util::AbstractConfiguration & config); } }