Wyatt  1.0.1
MessageLengthException.h
1 //
2 // Created by Tucker Haydon on 4/25/17.
3 //
4 
5 #pragma once
6 
7 #include "Hardware.h"
8 #include <string>
9 
13 class MessageLengthException: public std::exception {
14 
15 public:
20  MessageLengthException(Hardware h) : std::exception() {
21  this->hardware = hardware;
22  }
23 
28  virtual const char* what() const throw() {
29  std::string msg("Message length does not match hardware description.\n");
30  msg += "Hardware address: ";
31  msg += (int)hardware.address;
32  return msg.c_str();
33  }
34 
35 private:
36  Hardware hardware;
37 };
38 
virtual const char * what() const