| 15 | |
| 16 | template <typename ... Ts> |
| 17 | bool ScriptAssertF(bool cond, std::string_view str, Ts...args) |
| 18 | { |
| 19 | if (!cond) |
| 20 | { |
| 21 | auto msg = fmt::format(str, args...); |
| 22 | switch (GetScriptErrorMode()) |
| 23 | { |
| 24 | case ErrorMode::Warn: |
| 25 | TENLog(msg, LogLevel::Error, LogConfig::All); |
| 26 | break; |
| 27 | |
| 28 | case ErrorMode::Terminate: |
| 29 | TENLog(msg, LogLevel::Error, LogConfig::All); |
| 30 | throw TENScriptException(msg); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | return cond; |
| 35 | } |
| 36 | |
| 37 | template <typename ... Ts> |
| 38 | bool ScriptAssertTerminateF(bool cond, std::string_view str, Ts...args) |
no test coverage detected