blob: 50166977549cb599feb737862557d3a23c4c36d0 [file] [log] [blame]
Jeff Thompsona92861a2013-10-16 14:06:23 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Yingdi Yu <yingdi@cs.ucla.edu>
5 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
6 * See COPYING for copyright and distribution information.
7 */
8
9#ifndef NDN_DER_EXCEPTION_HPP
10#define NDN_DER_EXCEPTION_HPP
11
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080012#include <stdexcept>
Jeff Thompsona92861a2013-10-16 14:06:23 -070013#include <string>
14
15namespace ndn {
16
17namespace der {
18
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080019struct DerException : public std::runtime_error { DerException(const std::string &msg) : std::runtime_error(msg) {} };
Jeff Thompsona92861a2013-10-16 14:06:23 -070020
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080021class NegativeLengthException : public DerException { NegativeLengthException(const std::string &msg) : DerException(msg) {} };
Jeff Thompsona92861a2013-10-16 14:06:23 -070022
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080023class DerEncodingException : public DerException { DerEncodingException(const std::string &msg) : DerException(msg) {} };
Jeff Thompsona92861a2013-10-16 14:06:23 -070024
Alexander Afanasyev64a3d812014-01-05 23:35:05 -080025class DerDecodingException : public DerException { DerDecodingException(const std::string &msg) : DerException(msg) {} };
Jeff Thompsona92861a2013-10-16 14:06:23 -070026
27} // der
28
29}
30
31#endif