|
@@ -11,14 +11,24 @@
|
|
|
#define FILE_OPERATION_EXCEPTION_HPP
|
|
|
|
|
|
#include <exception>
|
|
|
+#include <string>
|
|
|
|
|
|
namespace ls_std {
|
|
|
class FileOperationException : public std::exception {
|
|
|
public:
|
|
|
|
|
|
+ explicit FileOperationException(std::string _filePath):
|
|
|
+ filePath(std::move(_filePath))
|
|
|
+ {}
|
|
|
+
|
|
|
const char *what() const noexcept override {
|
|
|
- return "file operation failed...";
|
|
|
+ const std::string errorMessage = "file operation failed!\nfile: " + this->filePath;
|
|
|
+ return std::move(errorMessage.c_str());
|
|
|
}
|
|
|
+
|
|
|
+ private:
|
|
|
+
|
|
|
+ std::string filePath {};
|
|
|
};
|
|
|
}
|
|
|
|