These functions accept a function and a default value. If the function returns an error, the default value is returned instead.
In these cases, I don't care what the error is, and it's discarded inside the helper function. I don't have a need to wrap these errors, but right now I don't have a good way to ignore those cases.
The package
lo
defines a series of helper functions namedTryOr
:https://github.com/samber/lo#tryor
These functions accept a function and a default value. If the function returns an error, the default value is returned instead.
In these cases, I don't care what the error is, and it's discarded inside the helper function. I don't have a need to wrap these errors, but right now I don't have a good way to ignore those cases.