ASP 3.0 Advanced Programming (30)

Source: Internet
Author: User
7th Chapter Debugging and error handling
The basic skills required to use ASP are described earlier, and the other issue in this chapter is what to do when an ASP error occurs, and what happens when an ASP goes wrong. When a carefully choreographed ASP page problem stops executing, the user generally gets only a few useful suggestions, such as clicking the Refresh button, or contacting the Web administrator of the site to tell them that your page is not working properly, and so on.
In addition to providing useful information, this chapter wants to provide a help area. We will describe in detail how errors occur in scripts and pages, the types of errors that can occur, and what causes these errors. What is more important is to discuss how to avoid mistakes as much as possible, and how to deal with them if they cannot be avoided.
Therefore, this chapter will explore the page debugging technology, that is, how to spend a little energy and time to find errors and solve problems.
This chapter includes the following elements:
· The type of error that can occur.
· How to prevent the emergence of various errors.
· How to handle these errors properly if you cannot prevent errors from occurring.
· How to discover and handle scripting errors and other types of errors.
· How to use the custom error page to get the error message.
· How to record errors to monitor our site.
· Create a custom error page and an error log file.
· Provide related online help.
This chapter does not address the various special types of errors that occur when you access a data source using ActiveX Data Objects (ADO). Like many components, ADO provides its own error-handling system, which is discussed in depth in chapter 8th. This chapter starts by discussing the various types of errors that can occur, enabling us to recognize these errors and take appropriate action.
It is said that in the depths of Africa's darkest rainforest, there are such a group of programmers whose code of procedure has never been wrong. Unfortunately, they have never had the pleasure of debugging an application that doesn't work properly. Debugger code is a really fun job, so we have to face this problem, in the process of debugging procedures to test our observation and lateral thinking ability. Most "real world" programmers can experience these pleasures as a good thing.
Of course, some people will say that the debugger is more of a chance than a judgment. It takes a lot of time to debug a faulty program, which in a way can be said to depend on luck. However, if the first step starts at the right place, you may be able to solve the problem more quickly.
But this is not the way the program should be debugged. Theoretically, when a program fails, the error should be tracked in a logical or sequential manner. As a smart and experienced programmer, this is the common method of debugging, only amateurs can change the value of the variable in the program, everywhere add Response.Write statements for debugging.
However, in order to be able to logically track bugs in a program, you must understand the basics of how the error occurred, and more importantly, know where the error occurred so that you can quickly find the appropriate place. This chapter discusses the different kinds of errors that can occur in a program, the different manifestations of errors, and how to record and troubleshoot these errors. It is also important to explain how to avoid these errors.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.