Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
157 stars 51 forks source link

xpcall() passes its second argument to wrapped function #170

Closed yackimoff closed 2 years ago

yackimoff commented 2 years ago

Describe the bug xpcall should receive error handler as second parameter and vararg parameters after it, which it should pass to a wrapped function. But it passes error handler as the first parameter to the function.

Panakotta00 commented 2 years ago

That is intended... due to some technical limitations using xpcall with its error handler is unsafe/unpredictable for users at runtime which may result in random crashes. Due to this we essentially replaced xpcall with a pcall that contains additionally the stack trace in its error object it returns... since thats the most common usecase for the error handler... Until we find a solution for the issue "c-call boundary error", you wont be able to use xpcall the normal way. Since we now also experience the same issue with string.gsub and a handler function, the importance of that matter rose, but I cant tell you when and if a workaround for these problems will be created...