Wolfram Language Paclet Repository
Community-contributed installable additions to the Wolfram Language
Prototype implementation of next-generation error handling for Wolfram Language, from the Error Handling Working Group (EHWG)
Contributed by: Error Handling Working Group
This paclet contains experimental prototypes of new functions and frameworks for robustly and ergonomically reporting and handling of error conditions within Wolfram Language code.
This paclet is a product of the Error Handling Working Group.
To install this paclet in your Wolfram Language environment,
evaluate this code:
PacletInstall["Wolfram/ErrorTools"]
Register a new error tag:
In[1]:= | ![]() |
Out[1]= | ![]() |
Create a new Failure[..] with the specified tag:
In[2]:= | ![]() |
Out[2]= | ![]() |
Construct and throw a Failure[..] as an exception, without handling the failure:
In[3]:= | ![]() |
Out[3]= | ![]() |
Handle the raised Failure:
In[4]:= | ![]() |
Out[4]= | ![]() |
Define a function that can raise multiple types of failure:
In[5]:= | ![]() |
Handle any type of failure:
In[6]:= | ![]() |
Out[6]= | ![]() |
In[7]:= | ![]() |
Out[7]= | ![]() |
Handle only Failure's with a specific tag:
In[8]:= | ![]() |
Handle does not catch a Failure if no handler rule matches it:
In[9]:= | ![]() |
Out[9]= | ![]() |
Define a function that throws an error when called with unexpected arguments:
In[10]:= | ![]() |
In[11]:= | ![]() |
Say hello with a valid string argument:
In[12]:= | ![]() |
Try to say hello with an invalid argument:
In[13]:= | ![]() |
Out[13]= | ![]() |
Wolfram Language Version 13.2