The Facebook Platform   
    Home  |   Learn AJAX  |   Forum  |    Register  |    Submit Resource  |   Submit Article   |   Contact Us
 

AJAX Tips

Home AJAX Tips

Understanding Error Extensions in MS Ajax

Category: AJAX Tips   |   Comments (0)

Error messages in any programming language are very useful because these messages allow developers to slowly improve their application. Without these messages, the possibility that the application will not work is high as there is no indicator if the function will work as expected. Developers have to create these messages in order to create interactive application that will provide the needed function if an error happens.


Sponsored Links
 

 


Microsoft Ajax has a set of error codes that can be added by developers in their JavaScript and Ajax based applications. These error messages do not just inform developers if there's something wrong with the application.


The following are common error extensions from MS Ajax that can be added in an Ajax based applications:


Error.argument


One of the most popular error extensions in any programming language, this extension simply informs the user that something is wrong with the application. On the developer's end, the error code creates an object where developers can specify the error message. The error extension also creates a report about the parameter through Sys.ArgumentException object.


Similar error extensions with variety based on the argument are also available and they are the following:


• Error.argumentNull
• Error.argumentType
• Error.argumentUndefined


Error.create


Another basic error code but a lot more straightforward compared to the previous error extension. With this code, developers simply provide a message regarding the erroneous function or interaction in the application. No additional actions can be expected except that an error object is created.


Error.invalidOperation


The error is created when the functions provided by the application cannot work with the expected data. Just like previous functions, this extension automatically creates an object where developers can use as a basis for another function. An error message customized by developers is also created as well as the parameters that might have caused the problem.


Error.notImplemented


Like the error.create function, this error extension should be added by developers if they expect their application will encounter data that cannot be used. This error extension simply creates an object so that it can create interaction with additional functions created by developers.


Error.argumentOutofRange


This error extension is highly recommended in data intensive applications. This error can help developers weed out unnecessary data or information that cannot be used in the application. Error.argumentOutOfRange can be used for easier interaction as it can inform users to edit the data they have provided.


Error.parameterCount


As indicated, this form of error extension should be added when the function fails to interpret the parameters in the application. It will also create an object where developers can react or create another "route" based on the error received.


Error.popstackFrame


This error extension can be applied to other error extensions. It is main function is to update the developer regarding the exact location of the error. This is added to easily implement troubleshooting in the application.


Choosing the Right Error Extensions



Sponsored Links
 

 

While these are important error extensions, not every error extension is useful in an Ajax or JavaScript based application. Anticipate the possible errors in the application to effectively choose the error extensions and speed up the development of the application.



Read Next: String Extensions in MS Ajax


 
Post Your Comment
Members - Please Click here Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification:
 
 Subscribe    

Post Your Comment via FaceBook

Connect with Facebook



 
Comments
 
 
 
 

Sponsored Links

 

Copyright © 2005 - 2010 AjaxWith.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape