Closed mgacummings closed 2 years ago
Macaulay2 has a couple functions relating to error catching.
error
can be used to print an error messagetry
is similar to if
, where it has two following blocks of code, one which executes if there is no error, and one which executes if there is. However, note the caveat on the documentation page, "users are recommended to use this function sparingly, if at all".There's also throw
and catch
but I'm not sure if they're what we are looking for.
I have not been able to find any suggestions/recommendations/guidelines in the documentation for error catching in a new package.
From looking at other packages, most of the error handling is left up to Macaulay2, with few methods added in with packages themselves.
Some methods may need some sort of error catching capabilities. What incorrect inputs might a user have? How do we handle them?