Files
scylladb/sstables/exceptions.hh
Glauber Costa f8d35ef5ec sstables: move exception to its own file.
I am moving the malformed exception here, to avoid circular dependencies.
But since the file now exists, let's move them all.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-28 17:30:44 -05:00

23 lines
587 B
C++

/*
* Copyright (C) 2015 Cloudius Systems, Ltd.
*
*/
#pragma once
namespace sstables {
class malformed_sstable_exception : public std::exception {
sstring _msg;
public:
malformed_sstable_exception(sstring s) : _msg(s) {}
const char *what() const noexcept {
return _msg.c_str();
}
};
struct bufsize_mismatch_exception : malformed_sstable_exception {
bufsize_mismatch_exception(size_t size, size_t expected) :
malformed_sstable_exception(sprint("Buffer improperly sized to hold requested data. Got: %ld. Expected: %ld", size, expected))
{}
};
}