Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio .NET
JScript
Reference
Errors
 JS5022: Exception thrown and not ca...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2003/.NET Framework 1.1

Other versions are also available for the following:
JScript .NET
JS5022: Exception thrown and not caught

The code includes a throw statement that is not enclosed within a try block, or the code does not include an associated catch block to trap the error. Exceptions that are thrown from within the try block using the throw statement are caught outside the try block by a catch statement.

To correct this error

  • Enclose code that can throw an exception in a try block, and ensure there is a corresponding catch block.
  • Make sure a catch statement expects the correct form of exception.
  • If the exception is rethrown, make sure there is another corresponding catch statement.

See Also

Error Object | throw Statement | try...catch...finally Statement

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker