Coverage report for gui


src/
File: src/utils/Exception.hpp
Date: 2024-06-25 10:57:02
Lines:
1/2
50.0%
Functions:
1/2
50.0%
Branches:
2/4
50.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2024
3 ** Zappy GUI
4 ** File description:
5 ** Exceptions
6 */
7
8 #ifndef EXCEPTIONS_HPP
9 #define EXCEPTIONS_HPP
10
11 #include <exception>
12 #include <string>
13
14 namespace utils
15 {
16 class Exception : public std::exception {
17 public:
18
2/4
✓ Branch 1 taken 15 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 15 times.
✗ Branch 5 not taken.
30 Exception(const std::string &name, const std::string &message) : _message(name + ": " + message) {}
19 [[nodiscard]] const char *what() const noexcept override { return _message.c_str(); }
20
21 private:
22 std::string _message;
23 };
24 } // namespace utils
25
26 #endif // EXCEPTIONS_HPP
27