From fc26d965f07fc1575e8d2aa5620deb985624d6f6 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Sun, 3 Sep 2023 11:23:21 +0000 Subject: [PATCH] add: exeption message --- ex00/src/Bureaucrat.cpp | 4 ++-- ex01/src/Bureaucrat.cpp | 4 ++-- ex01/src/Form.cpp | 10 ++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ex00/src/Bureaucrat.cpp b/ex00/src/Bureaucrat.cpp index 0777385..b04c29f 100644 --- a/ex00/src/Bureaucrat.cpp +++ b/ex00/src/Bureaucrat.cpp @@ -68,12 +68,12 @@ void Bureaucrat::decrement() const char* Bureaucrat::GradeTooLowException::what() const throw() { - return "Too small grade"; + return "Too low grade"; } const char* Bureaucrat::GradeTooHighException::what() const throw() { - return "Too big grade"; + return "Too high grade"; } std::ostream& operator<<(std::ostream &stream, Bureaucrat &src) diff --git a/ex01/src/Bureaucrat.cpp b/ex01/src/Bureaucrat.cpp index 9422304..f2a0e98 100644 --- a/ex01/src/Bureaucrat.cpp +++ b/ex01/src/Bureaucrat.cpp @@ -73,12 +73,12 @@ void Bureaucrat::signForm(Form& form) const const char* Bureaucrat::GradeTooLowException::what() const throw() { - return "Too small grade"; + return "Too low grade"; } const char* Bureaucrat::GradeTooHighException::what() const throw() { - return "Too big grade"; + return "Too high grade"; } std::ostream& operator<<(std::ostream &stream, Bureaucrat &src) diff --git a/ex01/src/Form.cpp b/ex01/src/Form.cpp index d80c798..7c45701 100644 --- a/ex01/src/Form.cpp +++ b/ex01/src/Form.cpp @@ -81,3 +81,13 @@ std::ostream& operator<<(std::ostream& os, const Form& src) return os; } + +const char* Bureaucrat::GradeTooLowException::what() const throw() +{ + return "grade is to low"; +} + +const char* Bureaucrat::GradeTooHighException::what() const throw() +{ + return "grade is to high"; +}