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.hpp19
1 files changed, 19 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..f8ed21b
--- /dev/null
+++ b/src/openvic-dataloader/detail/Errors.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include "openvic-dataloader/v2script/Parser.hpp"
+
+namespace ovdl::v2script::errors {
+ inline const v2script::Parser::Error 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 v2script::Parser::Error { Parser::Error::Type::Fatal, message, 1 };
+ }
+}
+
+namespace ovdl::ovscript::errors {
+} \ No newline at end of file