You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Go it is a common practice to have functions, which return errors in case something went wrong, e.g. func Foo() (FooResult, error).
Doing so it is up to the caller to decide whether this is a fatal error or something that can be handled properly.
Considering the following Go code, which registers a function in Lua, what would be the best way to handle errors? Should we just panic, which would raise an exception in Lua or is there a better way to do that?
In Go it is a common practice to have functions, which return errors in case something went wrong, e.g.
func Foo() (FooResult, error)
.Doing so it is up to the caller to decide whether this is a fatal error or something that can be handled properly.
Considering the following Go code, which registers a function in Lua, what would be the best way to handle errors? Should we just
panic
, which would raise an exception in Lua or is there a better way to do that?And the following example Lua code.
Thanks,
Marin
The text was updated successfully, but these errors were encountered: