-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbankerror.h
61 lines (52 loc) · 2.53 KB
/
bankerror.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef BANKERROR_H
#define BANKERROR_H
#include <iostream>
/** ***********************************************************************************************
* @namespace bankerror
* @brief it contains all the enums and string constants related to bank-management related errors.
* ***********************************************************************************************/
namespace bankerror
{
/** ***********************************************************************************
* @namespace errmsg
* @brief This stores the string constants that contains message for custom exceptions.
* ***********************************************************************************/
namespace errmsg {
const std::string INVALID_USER = "INVALID USERID OR PASSWORD";
const std::string USER_NOT_FOUND = "NO USER FOUND WITH THE GIVEN USERID";
const std::string ACC_NOT_FOUND = "NO BANK ACCOUNT FOUND WITH GIVEN ACCOUNT NUMBER";
const std::string INVALID_PASSWORD = "INVALID PASSWORD IS ENTERED";
const std::string INSUFFICIENT_BALANCE = "INSUFFICIENT BALANCE IN BANK ACCOUNT TO WITHDRAW !";
const std::string NOT_AN_ADMIN = "USER IS NOT AN ADMIN";
}
/** **********************************************************************
* @enum ERROR_USER
* @brief Types of error related to class Staff, Admin and Account_Holder.
************************************************************************/
enum ERROR_USER
{
/** @brief if given userid does not exist in database. */
USER_NOT_FOUND,
/** @brief if given password does not match with password in database. */
INVALID_PASSWORD,
/** @brief if given staffid is not an admin. */
NOT_AN_ADMIN,
/** **************************************************
* @brief covers all the exceptions of this enum.
* Common exception for any invalid login credentials.
****************************************************/
INVALID_USER
};
/** ************************************************************
* @enum ERROR_BANK_ACCOUNT
* @brief Types of error related to class Account(bank account).
**************************************************************/
enum ERROR_BANK_ACCOUNT
{
/** @brief if bank account not found in the database. */
ACC_NOT_FOUND,
/** @brief if bank account does not have enough balance. */
INSUFFICIENT_BALANCE
};
}
#endif // BANKERROR_H