Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

15.2. Using the Error Class

The ASP.NET AJAX Script Library includes several useful classes with respect to debugging and testing, including the Error and Sys.Debug classes. The Error class extends the native JavaScript Error object and allows more specific error objects and messages to be created for a given error. It is used extensively throughout the ASP.NET AJAX Library debug scripts to test that the correct number of parameters are passed to functions, passed parameter types match up with the expected types, types aren't undefined, functions are fully implemented, and much more. The Error class is used sparingly in the release version of the ASP.NET AJAX Library scripts so that file sizes are minimized as much as possible.

The Error class has several different functions that can be used to create specific types of errors. The majority of the functions that can be called to create error objects relate specifically to function parameters, but others exist that are used by classes such as the PageRequestManager class. All of the Error class's available functions are shown in the following table.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint