classic asp try catch error
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn asp on error goto more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags asp on error goto 0 Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, classic asp global error handling helping each other. Join them; it only takes a minute: Sign up Is try-catch like error handling possible in ASP Classic? up vote 26 down vote favorite 9 What options are there in ASP Classic for error handling?
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings on error goto 0 vbscript and policies of this site About Us Learn more about Stack Overflow
Asp.net Error Handlingthe company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
On Error Resume NextUsers Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only http://stackoverflow.com/questions/472558/is-try-catch-like-error-handling-possible-in-asp-classic takes a minute: Sign up Try-Catch-End Try in VBScript up vote 22 down vote favorite 6 I'm trying the following code: Try Throw 2 'How do I throw an exception? Catch ex 'What do I do here? End Try but I'm getting the error Statement expected in the catch clause. Does anyone know how I can catch/throw exceptions in VBScript http://stackoverflow.com/questions/4999364/try-catch-end-try-in-vbscript using try/catch? (I am not looking for solutions with On Error Do X.) vbscript try-catch share|improve this question asked Feb 15 '11 at 2:25 Mehrdad 103k64310612 3 Then you're going to be very disappointed. There's no Try-Catch support in pre-.NET versions of VB, including VB 6, VBA, and VBScript. On Error Resume Next isn't so bad if you know how to use it correctly. –Cody Gray Feb 15 '11 at 8:35 Yeah, I am disappointed. :( On Error Resume Next used to be my favorite command back in middle school, when I learned VB 6... it quickly became my most hated command after I learned C#. I guess I'll use it but I really don't want to. –Mehrdad Feb 15 '11 at 8:44 See below for some tips on using it correctly! :-) –Mark Ribau Sep 8 '11 at 5:30 add a comment| 4 Answers 4 active oldest votes up vote 16 down vote accepted VBScript doesn't have Try/Catch. (VBScript language reference. If it had Try, it would be listed in the Statements section.) On
.NET 4 Error handling can be done in three ways in .NET 4.1 Classic ASP 5 Vulnerable Patterns for Error Handling 5.1 Page_Error 5.2 Global.asax 5.3 Web.config 6 Best Practices for Error Handling 6.1 Try & Catch (Java/ .NET) 6.2 Releasing resources and good housekeeping 6.3 Centralised exception handling (Struts Example) Error, Exception Handling & Logging An important aspect of secure application development is to prevent information leakage. Error messages give an attacker great insight into the inner workings of an application. The purpose of reviewing the Error Handling code is to assure the application fails safely under all possible error conditions, expected and unexpected. No sensitive information is presented to the user when an error occurs. For example SQL injection is much tougher to successfully pull off without some healthy error messages. It lessens the attack footprint and our attacker would have to resort to use “blind SQL injection” which is more difficult and time consuming. A well-planned error/exception handling strategy is important for three reasons: Good error handling does not give an attacker any information which is a means to an end, attacking the application A proper centralised error strategy is easier to maintain and reduces the chance of any uncaught errors “Bubbling up” to the front end of an application. Information leakage can lead to social engineering exploits. Some development languages provide checked exceptions which mean that the compiler shall complain if an exception for a particular API call is not caught Java and C# are good examples of this. Languages like C++ and C do not provide this safety net. Languages with checked exception handling still are prone to information leakage as not all types of error are checked for. When an exception or error is thrown we also need to log this occurrence. Sometimes this is due to bad development, but it can be the result of an attack or some