der-exception.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
23 #ifndef NDN_DER_EXCEPTION_HPP
24 #define NDN_DER_EXCEPTION_HPP
25 
26 #include <exception>
27 #include <string>
28 
29 namespace ndn {
30 
31 class DerException : public std::exception {
32 public:
33  DerException(const std::string& errorMessage) throw();
34 
35  ~DerException() throw();
36 
37  std::string Msg() { return errorMessage_; }
38 
39  virtual const char* what() const throw() { return errorMessage_.c_str(); }
40 
41 private:
42  const std::string errorMessage_;
43 };
44 
46 {
47 public:
48  NegativeLengthException(const std::string& errorMessage)
49  : DerException(errorMessage)
50  {}
51 };
52 
54 {
55 public:
56  DerEncodingException(const std::string& errorMessage)
57  : DerException(errorMessage)
58  {}
59 };
60 
62 {
63 public:
64  DerDecodingException(const std::string& errorMessage)
65  : DerException(errorMessage)
66  {}
67 };
68 
69 }
70 
71 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
Definition: der-exception.hpp:61
Definition: der-exception.hpp:31
Definition: der-exception.hpp:53
Definition: der-exception.hpp:45