Yingdi Yu | 38e329b | 2013-10-10 22:11:35 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013, Regents of the University of California |
| 4 | * Yingdi Yu |
| 5 | * |
| 6 | * BSD license, See the LICENSE file for more information |
| 7 | * |
| 8 | * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 9 | */ |
| 10 | |
| 11 | #ifndef LINKEDN_EXCEPTION_H |
| 12 | #define LINKEDN_EXCEPTION_H |
| 13 | |
| 14 | #include <exception> |
| 15 | #include <string> |
| 16 | |
| 17 | class LnException : public std::exception |
| 18 | { |
| 19 | public: |
| 20 | LnException(const std::string & errMsg) throw(); |
| 21 | |
| 22 | ~LnException() throw() |
| 23 | {} |
| 24 | |
Yingdi Yu | 42f6646 | 2013-10-31 17:38:22 -0700 | [diff] [blame] | 25 | const char* what() const throw() |
| 26 | { |
| 27 | return m_errMsg.c_str(); |
| 28 | } |
Yingdi Yu | 38e329b | 2013-10-10 22:11:35 -0700 | [diff] [blame] | 29 | |
| 30 | private: |
| 31 | const std::string m_errMsg; |
| 32 | }; |
| 33 | |
| 34 | #endif |