Skip to content
Snippets Groups Projects
errors.hh 573 B
Newer Older
  • Learn to ignore specific revisions
  • #ifndef __VEREIGN_BYTES_ERRORS_HH
    #define __VEREIGN_BYTES_ERRORS_HH
    
    #include <stdexcept>
    
    namespace vereign::bytes {
    
    class Error : public std::runtime_error {
    public:
      Error(const std::string& what)
        : std::runtime_error{what}
      {
    
      }
    };
    
    class IndexOutOfBounds : public Error {
    public:
      IndexOutOfBounds()
        : Error{"index out of bounds"}
      {
      }
    };
    
    class IncrementOutOfBounds : public Error {
    public:
      IncrementOutOfBounds()
        : Error{"cannot increment size pass the capacity"}
      {
      }
    };
    
    } // namespace vereign::bytes
    
    #endif // __VEREIGN_BYTES_ERRORS_HH