wisc_db
insufficient_space_exception.cpp
1 
8 #include "insufficient_space_exception.h"
9 
10 #include <sstream>
11 #include <string>
12 
13 namespace wiscdb {
14 
16  const PageId page_num, const std::size_t requested,
17  const std::size_t available)
18  : WiscDbException(""),
19  page_number_(page_num),
20  space_requested_(requested),
21  space_available_(available) {
22  std::stringstream ss;
23  ss << "Insufficient space in page " << page_number_
24  << "to hold record. Requested: " << space_requested_ << " bytes."
25  << " Available: " << space_available_ << " bytes.";
26  message_.assign(ss.str());
27 }
28 
29 }
Definition: buffer.h:14
std::uint32_t PageId
Identifier for a page in a file.
Definition: types.h:15
InsufficientSpaceException(const PageId page_num, const std::size_t requested, const std::size_t available)
Base class for all WiscDB-specific exceptions.