Atitit. Process-oriented programming language exception handling the try catch implementation of C-language ASP VBS

Source: Internet
Author: User
Tags try catch

Atitit. process-oriented programming language exception handling C language ASP vbs of the Try Catch Implement

1. Return value method . and global ERROR variable Method 1

2. Throw Exception Err.Raise 1

3. Implement try on Error Resume Next 1

4. Catch Practice 2

5. Reference 2

1. Return value method. andGlobalERROR Variable method

return value method .

C Language process only return value method ...

A better approach is the global variable approach , similar to the one implemented by ASP vbs .

2. Throw Exception Err.Raise

Only by changing the err.description implementation of ERR: Throw num does not understand ... Han style throw desc better ...

Call Err.Clear before throwing more good bar.

Note: To generate a run-time error in code, use the Raise method of the Err object.

Err.Clear
Err.Raise vbObjectError + 7, _
"Etest.asp", "Connection Open Method Failed"

In this way, we define our own error messages, and interested friends can try
The following is the output of this error message:
Error on line-7
Error Source-etest.asp
Error Desc-Connection Open Method Failed

Author :: Old Wow's paw attilax ayron, email:[email protected]

Reprint please indicate source: Http://blog.csdn.net/attilax

3. ImplementTryOn Error Resume Next

Only on Error Resume Next statement, but this global on err next only takes effect on global scripts ... Method blackheads require a single on err next to be prepared for the third walk does not take effect.

The on Error Resume Next statement becomes inactive when another procedure is called. Therefore, if you want internal error handling in the routine, you should execute the On Error Resume Next statement in each called routine.

4. Catchthe Practice

Reference JS Multi-level catch implementation ...

if (err.description== "Aaaex" Then

Xxxxx ()

5. Reference

Atitit.js JavaScript exception handling mechanism and Java exception conversion multiple CATC hdwr Environment . JS exception Process Vob7-attilax 's Column - Blog channel -CSDN.NET.htm

error handling for atitit.asp vbs . WPS

ASP Tip: The use of three commonly used statements in ASP - webmaster home . htm

Use Err.Raise to customize error messages _PC6 information. htm

Atitit. Process-oriented programming language exception handling the try catch implementation of C-language ASP VBS

Related Article

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.