Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Errors may be propagated from one function to another using the returned value explicitly.

Let us define a custom error enum for a factorial function:

Here is the factorial function that returns an error when the input number is negative:

The following combination function propagates the error of any call to the factorial function:

Here is an example that triggers an error:

Err(ForbiddenNumber)