GCC Code Coverage Report


Directory: ../
File: src/exception/LinkerError.h
Date: 2025-02-05 01:09:36
Exec Total Coverage
Lines: 0 0 -%
Functions: 0 0 -%
Branches: 0 0 -%

Line Branch Exec Source
1 // Copyright (c) 2021-2025 ChilliBits. All rights reserved.
2
3 #pragma once
4
5 #include <cstdint>
6 #include <string>
7
8 namespace spice::compiler {
9
10 enum LinkerErrorType : uint8_t {
11 LINKER_NOT_FOUND,
12 LINKER_ERROR,
13 };
14
15 /**
16 * Custom exception for errors, occurring when linking the output executable
17 */
18 class LinkerError final : public std::exception {
19 public:
20 // Constructors
21 LinkerError(const LinkerErrorType &type, const std::string &message);
22
23 // Public methods
24 [[nodiscard]] const char *what() const noexcept override;
25 [[nodiscard]] static std::string getMessagePrefix(LinkerErrorType errorType);
26
27 // Public members
28 std::string errorMessage;
29 };
30
31 } // namespace spice::compiler
32