lintel 0.2.0
Loading...
Searching...
No Matches
FileServiceIsNotFileException.h
Go to the documentation of this file.
1#pragma once
2
3#include <exception>
4#include <filesystem>
5#include <format>
6
7namespace lintel {
9class FileServiceIsNotFileException : public std::exception
10{
11private:
12 const std::filesystem::path m_path;
13 const std::string m_message;
14
15public:
17 explicit FileServiceIsNotFileException(const std::filesystem::path &path)
18 : m_path(path), m_message(std::format("No Operation possible bc. {} is not a file", path.string()))
19 {}
20
21 [[nodiscard]] const char *what() const noexcept override { return m_message.c_str(); }
22
24 [[nodiscard]] const std::filesystem::path &getPath() const { return m_path; }
25};
26}// namespace lintel
Definition FileServiceIsNotFileException.h:10
const char * what() const noexcept override
Definition FileServiceIsNotFileException.h:21
const std::filesystem::path & getPath() const
Definition FileServiceIsNotFileException.h:24
FileServiceIsNotFileException(const std::filesystem::path &path)
Definition FileServiceIsNotFileException.h:17
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9