aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-dataloader/detail/Errors.hpp
blob: bf7c831bc1c328a9a7d8addfb01c70941d01d817 (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
#pragma once

#include <openvic-dataloader/ParseError.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 {
}