aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-dataloader/detail/Errors.hpp
blob: fbebcc5605391b4eb62f15184ca4ebdf7b941522 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include <string_view>

#include <openvic-dataloader/ParseError.hpp>

namespace ovdl::errors {
   inline const ParseError make_no_file_error(std::string_view file_path) {
      std::string message;
      if (file_path.empty()) {
         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 {
}