MCPcopy Index your code
hub / github.com/yuin/gopher-lua / Error

Method Error

state.go:1734–1744  ·  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

1732
1733// This function is equivalent to lua_error( http://www.lua.org/manual/5.1/manual.html#lua_error ).
1734func (ls *LState) Error(lv LValue, level int) {
1735 if str, ok := lv.(LString); ok {
1736 ls.raiseError(level, string(str))
1737 } else {
1738 if !ls.hasErrorFunc {
1739 ls.closeAllUpvalues()
1740 }
1741 ls.Push(lv)
1742 ls.Panic(ls)
1743 }
1744}
1745
1746func (ls *LState) GetInfo(what string, dbg *Debug, fn LValue) (LValue, error) {
1747 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