-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathException.h
More file actions
45 lines (39 loc) · 745 Bytes
/
Exception.h
File metadata and controls
45 lines (39 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __EXECPTION_H__
#define __EXECPTION_H__
enum
{
FILE_OPEN_FAILED = 1,
MALLOC_FAILED = 2,
INVALID_FILE = 3,
READ_FAILED = 4,
WRITE_FAILED = 5,
FAILED_TO_GET_FILE_INFORMATION = 6,
ENC_ERROR = 7,
DEC_ERROR = 8,
OPENSSL_INIT_ERROR = 9
};
/**
* Exception class
*/
class Exception
{
private:
int errorCode;
public:
/**
* Constructor
* @Param int - error code
*/
Exception(int errorCode);
/**
* Function to return appropriate error message based on error code
* @Return char* - error message
*/
const char *getMessage();
/**
* Function to return appropriate error code
* @Return int - error message
*/
int getErrno();
};
#endif