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
38  Msg() const { return errorMessage_; }
39 
40  virtual const char*
41  what() const throw();
42 
43 private:
44  const std::string errorMessage_;
45 };
46 
48 {
49 public:
50  NegativeLengthException(const std::string& errorMessage)
51  : DerException(errorMessage)
52  {}
53 };
54 
56 {
57 public:
58  DerEncodingException(const std::string& errorMessage)
59  : DerException(errorMessage)
60  {}
61 };
62 
64 {
65 public:
66  DerDecodingException(const std::string& errorMessage)
67  : DerException(errorMessage)
68  {}
69 };
70 
71 }
72 
73 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:36
Definition: der-exception.hpp:63
Definition: der-exception.hpp:31
Definition: der-exception.hpp:55
Definition: der-exception.hpp:47