MSPException

MSPException[type]
an exception that can be thrown by webMathematica page commands

DetailsDetails

  • A number of MSP commands throw an MSPException when some error situation occurs. These are caught by the page processing code, but it would be permissible for a page author to catch them and process them in some intermediate step.
  • The following exceptions can be thrown by MSPBlock.
  • MSPException["ParseError"]if the value cannot be interpreted by Mathematica
    MSPException["SecurityError"]if the value does not pass the security test
    MSPException["ValueError"]if the value is not a string, this indicates a programmatic error by the page author
    MSPException["VariableError"]if the variable is not a Mathematica symbol, this indicates a programmatic error by the page author
    MSPException["NoValueError"]if a variable has no value
    MSPException["VersionError"]if a version mismatch problem is found

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

You can simulate how the function works by installing and loading the package.

In[1]:=
Click for copyable input

If a variable cannot be interpreted, a ParseError exception is thrown. Since the values may be entered from the client, this does not indicate an author error.

In[2]:=
Click for copyable input
Out[2]=

If the result of interpretation does not pass the security check, a SecurityError exception is thrown. Since the values may be entered from the client, this does not indicate an author error.

In[3]:=
Click for copyable input
Out[3]=

If a variable that is not a Mathematica symbol is encountered, a VariableError exception is thrown. This usually indicates an author error.

In[4]:=
Click for copyable input
Out[4]=

If a value that is not a Mathematica string is encountered, a ValueError exception is thrown. This usually indicates an author error.

In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
Out[6]=
New to Mathematica? Find your learning path »
Have a question? Ask support »