MCPcopy Create free account
hub / github.com/ThePhD/sol2 / my_panic

Function my_panic

examples/source/docs/my_panic.cpp:5–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <iostream>
4
5inline void my_panic(sol::optional<std::string> maybe_msg) {
6 std::cerr << "Lua is in a panic state and will now abort() "
7 "the application"
8 << std::endl;
9 if (maybe_msg) {
10 const std::string& msg = maybe_msg.value();
11 std::cerr << "\terror message: " << msg << std::endl;
12 }
13 // When this function exits, Lua will exhibit default
14 // behavior and abort()
15}
16
17int main(int, char*[]) {
18 sol::state lua(sol::c_call<decltype(&my_panic), &my_panic>);

Callers

nothing calls this directly

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected