-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.hpp
More file actions
29 lines (25 loc) · 753 Bytes
/
error.hpp
File metadata and controls
29 lines (25 loc) · 753 Bytes
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
26
27
28
29
#pragma once
#include <string>
#include <iostream>
namespace pl {
auto RtError(std::string content) -> void {
std::cout << "\nRuntime Error:\n " << content << "\n";
exit(0);
}
auto CpError(std::string content) -> void {
std::cout << "\nCompile Error:\n " << content << "\n";
exit(0);
}
auto ParameterRequireError(std::string at, int requireCnt) -> std::string {
return at + " requires just " + std::to_string(requireCnt) + " parameters";
}
auto ParameterTypeError(std::string at, std::vector<std::string> requirement) -> std::string {
at += " requires just {";
for (int i = 0; i < requirement.size(); i++) {
at += requirement[i];
if (i != requirement.size() - 1) at += ", ";
}
at += "} parameters";
return at;
}
}