More verbose error message [#CLICKHOUSE-2885].

This commit is contained in:
Alexey Milovidov 2017-03-14 22:31:15 +03:00
parent 701f69de6b
commit dd0b0205a1
2 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,5 @@
#include <DB/IO/CachedCompressedReadBuffer.h>
#include <DB/IO/WriteHelpers.h>
namespace DB
@ -93,7 +94,9 @@ void CachedCompressedReadBuffer::seek(size_t offset_in_compressed_file, size_t o
nextImpl();
if (offset_in_decompressed_block > working_buffer.size())
throw Exception("Seek position is beyond the decompressed block", ErrorCodes::SEEK_POSITION_OUT_OF_BOUND);
throw Exception("Seek position is beyond the decompressed block"
" (pos: " + toString(offset_in_decompressed_block) + ", block size: " + toString(working_buffer.size()) + ")",
ErrorCodes::SEEK_POSITION_OUT_OF_BOUND);
pos = working_buffer.begin() + offset_in_decompressed_block;
bytes -= offset();

View File

@ -1,5 +1,6 @@
#include <DB/IO/CompressedReadBufferFromFile.h>
#include <DB/IO/createReadBufferFromFileBase.h>
#include <DB/IO/WriteHelpers.h>
namespace DB
@ -57,7 +58,9 @@ void CompressedReadBufferFromFile::seek(size_t offset_in_compressed_file, size_t
nextImpl();
if (offset_in_decompressed_block > working_buffer.size())
throw Exception("Seek position is beyond the decompressed block", ErrorCodes::SEEK_POSITION_OUT_OF_BOUND);
throw Exception("Seek position is beyond the decompressed block"
" (pos: " + toString(offset_in_decompressed_block) + ", block size: " + toString(working_buffer.size()) + ")",
ErrorCodes::SEEK_POSITION_OUT_OF_BOUND);
pos = working_buffer.begin() + offset_in_decompressed_block;
bytes -= offset();