Class Pcall
Pcall
Usage:
Pcall(function()
-- code to try
end):pass(function()
print("Passed!")
end):fail(function()
print("Failed!")
end)
Methods
| Pcall:pass (fn) | Add pass function |
| Pcall:fail (fn) | Add fail function |
| Pcall:done () | Execute check function |
Metamethods
| Pcall:__call (t, check) | Create a Pcall |
Methods
- Pcall:pass (fn)
-
Add pass function
Parameters:
- fn function function to execute if pass the check function
Returns:
- Pcall:fail (fn)
-
Add fail function
Parameters:
- fn function function to execute if fail the check function
- Pcall:done ()
- Execute check function