-
Hey there! I'm currently working on implementing CC support in my mod FFS again and was curious about something. I already figured out that I can throw a I wonder if there's something similar for a method to return that it succeeded? For example, I have a method to lock the fluid in the tank and when it locks it I would like to return a string along the lines of "Locked fluid to [FLUID_NAME].". If this is not intended and I should rather just return a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I am not sure, that there is a commonly accepted way for this, but I can suggest to use something like Result Monad, which is effectefly just Update: Not a table, just one or two values for easly handle like in golang: local result, err = true, "haha"
if err ~= nil then
print(err)
end |
Beta Was this translation helpful? Give feedback.
I am not sure, that there is a commonly accepted way for this, but I can suggest to use something like Result Monad, which is effectefly just
returning tableand return exception only in cases of invalid output of some incorrect usage of function{isOperationSuccessful, problemWithOperation}
Update: Not a table, just one or two values for easly handle like in golang: