mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
HTTP Accept-Encoding: br; Added brotli errors codes
This commit is contained in:
parent
4b7ac9e9b4
commit
c53b303bc2
@ -420,6 +420,8 @@ namespace ErrorCodes
|
||||
extern const int NO_COMMON_COLUMNS_WITH_PROTOBUF_SCHEMA = 443;
|
||||
extern const int UNKNOWN_PROTOBUF_FORMAT = 444;
|
||||
extern const int CANNOT_MPROTECT = 445;
|
||||
extern const int BROTLI_READ_FAILED = 446;
|
||||
extern const int BROTLI_WRITE_FAILED = 447;
|
||||
|
||||
extern const int KEEPER_EXCEPTION = 999;
|
||||
extern const int POCO_EXCEPTION = 1000;
|
||||
|
@ -56,7 +56,7 @@ bool BrotliReadBuffer::nextImpl()
|
||||
|
||||
if (brotli->result == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT && (!in_available || in.eof()))
|
||||
{
|
||||
throw Exception(std::string("brotli decode error"), ErrorCodes::CANNOT_READ_ALL_DATA);
|
||||
throw Exception(std::string("brotli decode error"), ErrorCodes::BROTLI_READ_FAILED);
|
||||
}
|
||||
|
||||
out_capacity = internal_buffer.size();
|
||||
@ -76,13 +76,13 @@ bool BrotliReadBuffer::nextImpl()
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception(std::string("brotli decode error"), ErrorCodes::CANNOT_READ_ALL_DATA);
|
||||
throw Exception(std::string("brotli decode error"), ErrorCodes::BROTLI_READ_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
if (brotli->result == BROTLI_DECODER_RESULT_ERROR)
|
||||
{
|
||||
throw Exception(std::string("brotli decode error"), ErrorCodes::CANNOT_READ_ALL_DATA);
|
||||
throw Exception(std::string("brotli decode error"), ErrorCodes::BROTLI_READ_FAILED);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -7,6 +7,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int BROTLI_READ_FAILED;
|
||||
}
|
||||
|
||||
class BrotliReadBuffer : public BufferWithOwnMemory<ReadBuffer>
|
||||
{
|
||||
public:
|
||||
|
@ -72,7 +72,7 @@ void BrotliWriteBuffer::nextImpl()
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
throw Exception(std::string("brotli compress failed: "), ErrorCodes::CANNOT_WRITE_AFTER_END_OF_BUFFER);
|
||||
throw Exception(std::string("brotli compress failed"), ErrorCodes::BROTLI_WRITE_FAILED);
|
||||
}
|
||||
}
|
||||
while (in_available > 0 || out_capacity == 0);
|
||||
@ -110,7 +110,7 @@ void BrotliWriteBuffer::finish()
|
||||
|
||||
if (result == 0)
|
||||
{
|
||||
throw Exception(std::string("brotli compress failed: "), ErrorCodes::CANNOT_WRITE_AFTER_END_OF_BUFFER);
|
||||
throw Exception(std::string("brotli compress failed"), ErrorCodes::BROTLI_WRITE_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,12 @@
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int BROTLI_WRITE_FAILED;
|
||||
}
|
||||
|
||||
class BrotliWriteBuffer : public BufferWithOwnMemory<WriteBuffer>
|
||||
{
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user