-
Notifications
You must be signed in to change notification settings - Fork 0
/
Exception.h
41 lines (34 loc) 路 841 Bytes
/
Exception.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
//
// Created by samuel Benichou on 2020-01-19.
//
#ifndef HW5_EXCEPTION_H
#define HW5_EXCEPTION_H
#include <iostream>
#include <exception>
/*class Exception {
public:
Exception() throw();
Exception(const Exception& right) throw();
Exception& operator=(const Exception& right) throw();
virtual const char *what() const throw();
virtual ~Exception() throw();
};*/
class idException : public exception{
public:
virtual const char* what() const throw(){
return "Please enter valid id";
}
};
class nameError : public exception{
public:
virtual const char* what() const throw(){
return "Please enter valid name";
}
};
class dataError : public exception{
public:
virtual const char* what() const throw(){
return "Please enter valid details";
}
};
#endif //HW5_EXCEPTION_H