Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catch as Exception error........

Status
Not open for further replies.

TomTT

Programmer
Jun 3, 2002
55
0
0
US
I have a Try --> Catch --> End try
block in which I save input data to a database, send an email to the customer then (depending on payment type selected) transfer to PayPal or not.

The block works fine and catches errors properly.

The problem is that when I do a transfer to PayPal using a Response.Redirect, the browser transfers with no problem, but for some reason the Catch as Exception is triggered.

I know this because I have an email sent to me in the Catch routine.

I removed the Try-->catch to see if a real error was occuring but none occurred.

What's really odd is that on my local development machine, no Catch error is triggered, but when I load the code onto my remote server and try it I get the error email.......

Any ideas why this is occuring?

Thanks!!
 
What does the exception say?
Include the value for the InnerException property in your reply, too.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
OK,

I'm feeling a little dumb here.........
I added the innerException to the email sent to me in the catch block and uploaded it to the remote server.

Now, of course, there is no catch triggered when I response.redirect to PayPal......Go figure.

I'll keep trying to get it to trigger the catch block on redirect and if it does, at least the innerException is captured in the email.

I'll update as the error surfaces.

Thanks for the help.
Tom T
 
It may be a ThreadAbortException exception because of the Response.Redirect. Try adding this to your Try/Catch block and send a different email to yourself when this happens to see if it is the problem. e.g.
Code:
Try

Catch ex As Exception

Catch threx As Threading.ThreadAbortException

End Try


----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Thanks for the suggestion. It certainly sounds like the problem could be Thread abort. I'll add your suggested code and see what happens.

The odd thing is that the exception occured when I loaded to the remote server then stopped occuring..........

I'll post findings

Thanks again.
TT
 
Uhh, what I meant was, can you post the text of the exception here, so that we can be more helpful?

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top