Jetpack documentation 1.0.0
Loading...
Searching...
No Matches
Exception.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** jetpack
4** File description:
5** The Exception.hpp
6*/
13#ifndef EXCEPTION_HPP_
14 #define EXCEPTION_HPP_
15
16 #include "Logs.hpp"
17
18namespace Jetpack {
23 class JetpackUsage : public std::exception {
24 public:
28 explicit JetpackUsage() {}
32 ~JetpackUsage() override = default;
33 };
34
35
36
41 class JetpackStop : public std::exception {
42 public:
47 explicit JetpackStop(const std::string &message) : _message(message) {}
51 ~JetpackStop() override = default;
52
53
54
59 const char *what() const noexcept override { return _message.c_str(); }
60
61 private:
62 std::string _message; /* Message of the exception */
63 };
64
65
66
71 class JetpackError : public std::exception {
72 public:
77 explicit JetpackError(const std::string &message) : _message(message) {}
81 ~JetpackError() override = default;
82
83
84
89 const char *what() const noexcept override { return _message.c_str(); }
90
91 private:
92 std::string _message; /* Message of the exception */
93 };
94}
95
96#endif /* EXCEPTION_HPP_ */
The Logs.hpp.
An exception class for Jetpack errors.
Definition Exception.hpp:71
~JetpackError() override=default
Destructor for JetpackError class.
JetpackError(const std::string &message)
Constructor for JetpackError class.
Definition Exception.hpp:77
const char * what() const noexcept override
Gets the message of the exception.
Definition Exception.hpp:89
An exception class for stopping the Jetpack.
Definition Exception.hpp:41
JetpackStop(const std::string &message)
Constructor for JetpackStop class.
Definition Exception.hpp:47
~JetpackStop() override=default
Destructor for JetpackStop class.
const char * what() const noexcept override
Gets the message of the exception.
Definition Exception.hpp:59
An exception class for usage errors.
Definition Exception.hpp:23
JetpackUsage()
Constructor for JetpackUsage class.
Definition Exception.hpp:28
~JetpackUsage() override=default
Destructor for JetpackUsage class.