Skip to content

Commit c918b1b

Browse files
committed
Replace fmt.Println with L.ErrorNoHalt for error handling in TryCall and TryCPCall methods
1 parent 0022be2 commit c918b1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

glua.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ If there are no errors it returns true.
860860
*/
861861
func (L State) TryCall(nargs, nresults int) bool {
862862
if err := L.PCall(nargs, nresults, 0); err != nil {
863-
fmt.Println(err)
863+
L.ErrorNoHalt(err.Error())
864864
return false
865865
}
866866

@@ -878,7 +878,7 @@ func (L State) CPCall(funcPtr unsafe.Pointer, ud uintptr) error {
878878

879879
func (L State) TryCPCall(funcPtr unsafe.Pointer, ud uintptr) bool {
880880
if err := L.CPCall(funcPtr, ud); err != nil {
881-
fmt.Println(err)
881+
L.ErrorNoHalt(err.Error())
882882
return false
883883
}
884884

0 commit comments

Comments
 (0)