Skip to main content

catch

Discworld efun help

catch

mixed catch(string expr)

Evaluate expr. If there is no error, 0 is returned. If there is a standard error, a string (with a leading '*') will be returned.

The function throw(value) can be used to immediately return any value, except 0.

The catch() is somewhat costly, and should not be used just anywhere. Rather it should be used at places where an error would destroy consistency.