Salat Posted February 16, 2003 Posted February 16, 2003 I'm new to VB.NET I'm trying to catch some errors in the sub. But I found out that there is no "ON ERROR" command. What shell I use then? And some other question about errors. If I'm useing WebClient control, which doesn't have any events, which may corespond with it's status. There are errors generated, when time-out etc. How shell I then catch the error for this control? thanks for helping me... Piotrek Quote profesjonalne programowanie na zlecenie :)
*Gurus* Derek Stone Posted February 16, 2003 *Gurus* Posted February 16, 2003 Try 'Place code here that may cause an exception Catch e1 As ArgumentException 'Handle all exceptions that are of type "ArgumentException" Catch e2 As ArgumentNullException 'Handle all exceptions that are of type "ArgumentNullException" Catch e3 As FileNotFoundException 'Handle all exceptions that are of type "FileNotFoundException" Catch e4 As Exception 'Handle all other exceptions that weren't specifically handled above End Try Of course the type of exceptions are going to differ depending on the type that might be thrown, so make sure to customize each Try/Catch block for the code it contains. The ones I listed above were the first to come to mind, and are definately not appropriate for all situations. Quote Posting Guidelines
Salat Posted February 16, 2003 Author Posted February 16, 2003 thanks... that helps Quote profesjonalne programowanie na zlecenie :)
bungpeng Posted February 17, 2003 Posted February 17, 2003 you miss one... Try Catch Finally End Try :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.