MCPcopy Create free account
hub / github.com/yuin/gopher-lua / Error

Method Error

_state.go:1521–1531  ·  view source on GitHub ↗

This function is equivalent to lua_error( http://www.lua.org/manual/5.1/manual.html#lua_error ).

(lv LValue, level int)

Source from the content-addressed store, hash-verified

1519
1520// This function is equivalent to lua_error( http://www.lua.org/manual/5.1/manual.html#lua_error ).
1521func (ls *LState) Error(lv LValue, level int) {
1522 if str, ok := lv.(LString); ok {
1523 ls.raiseError(level, string(str))
1524 } else {
1525 if !ls.hasErrorFunc {
1526 ls.closeAllUpvalues()
1527 }
1528 ls.Push(lv)
1529 ls.Panic(ls)
1530 }
1531}
1532
1533func (ls *LState) GetInfo(what string, dbg *Debug, fn LValue) (LValue, error) {
1534 if !strings.HasPrefix(what, ">") {

Callers

nothing calls this directly

Calls 3

raiseErrorMethod · 0.95
closeAllUpvaluesMethod · 0.95
PushMethod · 0.95

Tested by

no test coverage detected