MCPcopy Create free account
hub / github.com/defold/defold / DefoldError

Function DefoldError

engine/script/src/luacjson/lua_cjson.c:1609–1625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1607////////////////////////////////////////////////////////////
1608
1609static int DefoldError(json_config_t* cfg, const char* format, ...)
1610{
1611 va_list argp;
1612 va_start(argp, format);
1613
1614 char tmp_buffer[256];
1615 char* buffer = cfg->error_message ? cfg->error_message : tmp_buffer;
1616 size_t buffer_len = cfg->error_message ? cfg->error_message_length : sizeof(tmp_buffer);
1617 vsnprintf(buffer, buffer_len, format, argp);
1618
1619 if (cfg->protected_mode)
1620 {
1621 return luaL_error(cfg->l, "%s", buffer);
1622 }
1623 va_end(argp);
1624 return 0;
1625}
1626
1627// Note: The major difference between this function and the internal
1628// cjson json_encode function is that we don't use the config

Callers 5

json_encode_exceptionFunction · 0.85
json_check_encode_depthFunction · 0.85
json_throw_parse_errorFunction · 0.85
json_decode_descendFunction · 0.85
lua_cjson_decodeFunction · 0.85

Calls 1

luaL_errorFunction · 0.85

Tested by

no test coverage detected