MCPcopy Index your code
hub / github.com/Shopify/go-lua / throw

Method throw

stack.go:388–403  ·  view source on GitHub ↗
(errorCode error)

Source from the content-addressed store, hash-verified

386}
387
388func (l *State) throw(errorCode error) {
389 if l.protectFunction != nil {
390 panic(errorCode)
391 } else {
392 l.error = errorCode
393 if g := l.global.mainThread; g.protectFunction != nil {
394 g.push(l.stack[l.top-1])
395 g.throw(errorCode)
396 } else {
397 if l.global.panicFunction != nil {
398 l.global.panicFunction(l)
399 }
400 log.Panicf("Uncaught Lua error: %v", errorCode)
401 }
402 }
403}
404
405func (l *State) protect(f func()) (err error) {
406 nestedGoCallCount, protectFunction := l.nestedGoCallCount, l.protectFunction

Callers 5

errorMessageMethod · 0.95
checkModeMethod · 0.95
callMethod · 0.95
growStackMethod · 0.95
scanErrorMethod · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected