MCPcopy Create free account
hub / github.com/InoriRus/Kyty / create_error

Function create_error

source/lib/Scripts/src/ScriptsFileLib.cpp:9–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7// void script_dbg_dump_stack(const String &prefix);
8
9static String create_error(ScriptError err, const String& msg1, const String& msg2)
10{
11 String err_str = String::FromPrintf("%s %s\n", msg1.C_Str(), msg2.C_Str());
12
13 switch (err)
14 {
15 case ScriptError::FileError: err_str += String::FromPrintf("file error\n"); break;
16 case ScriptError::SyntaxError: err_str += String::FromPrintf("syntax error:\n%s\n", GetErrMsg().C_Str()); break;
17 case ScriptError::RunError: err_str += String::FromPrintf("run error:\n%s\n", GetErrMsg().C_Str()); break;
18
19 case ScriptError::UnknownError:
20 default: err_str += String::FromPrintf("unknown error\n");
21 }
22
23 return err_str;
24}
25
26KYTY_STATIC_SCRIPT_FUNC(dofile)
27{

Callers 1

KYTY_STATIC_SCRIPT_FUNCFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected