A thought of new exception handling; add entrypoint for FireFox
[gssweb.git] / json_gssapi / src / GSSException.h
1 /*
2  * Copyright (c) 2014 <copyright holder> <email>
3  * 
4  * For license details, see the LICENSE file in the root of this project.
5  * 
6  */
7
8 #ifndef GSSEXCEPTION_H
9 #define GSSEXCEPTION_H
10
11 #include <exception>
12 #include <string>
13
14 #include <gssapi.h>
15
16 class GSSException : public std::exception
17 {
18 public:
19     GSSException(std::string msg, OM_uint32 major = 0, OM_uint32 minor = 0 , gss_OID mech = GSS_C_NO_OID);
20     ~GSSException(void) throw() {  }
21       
22     virtual const char* what(void) const throw() { return reason.c_str(); }
23     
24     // Accessors
25     OM_uint32 getMajor() { return(major); }
26     OM_uint32 getMinor() { return(minor); }
27     
28 private:
29     std::string reason;
30     OM_uint32 major, minor;
31 };
32
33 #endif // GSSEXCEPTION_H