aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-dataloader/detail/Errors.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-dataloader/detail/Errors.hpp')
-rw-r--r--src/openvic-dataloader/detail/Errors.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/openvic-dataloader/detail/Errors.hpp b/src/openvic-dataloader/detail/Errors.hpp
new file mode 100644
index 0000000..f53bedc
--- /dev/null
+++ b/src/openvic-dataloader/detail/Errors.hpp
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "openvic-dataloader/v2script/Parser.hpp"
+
+namespace ovdl::errors {
+ inline const ParseError make_no_file_error(const char* file_path) {
+ std::string message;
+ if (!file_path) {
+ message = "File path not specified.";
+ } else {
+ message = "File '" + std::string(file_path) + "' was not found.";
+ }
+
+ return ParseError { ParseError::Type::Fatal, message, 1 };
+ }
+}
+
+namespace ovdl::v2script::errors {
+
+}
+
+namespace ovdl::ovscript::errors {
+} \ No newline at end of file