Accept errors in custom functions

Refer to the following example code to see how to set CustomFunction arguments can accept errors.