StuckInTheMiddle
Programmer
Hi there,
I'm coding ASP.NET with VB and I've been nicely coding away for a few days getting things working and now that they do i thought it prudent to start putting in some error handling.
Rather then use the old 'on error goto' approach i thought that 'try..catch' was the way to go. However, even trying something simple as follows, i get error 'Cannot catch exception because its not of class system.exception'
try
myvar = mvothervar / someothervar
catch ex as exception when myvar = 0
response.write
end
The 'ex' is underlined, with the above error. I dont get this message when starting a new project, i really dont want to have to cut and paste all my code to a new project. Anyone any ideas about whats gone wrong?
I'm coding ASP.NET with VB and I've been nicely coding away for a few days getting things working and now that they do i thought it prudent to start putting in some error handling.
Rather then use the old 'on error goto' approach i thought that 'try..catch' was the way to go. However, even trying something simple as follows, i get error 'Cannot catch exception because its not of class system.exception'
try
myvar = mvothervar / someothervar
catch ex as exception when myvar = 0
response.write
end
The 'ex' is underlined, with the above error. I dont get this message when starting a new project, i really dont want to have to cut and paste all my code to a new project. Anyone any ideas about whats gone wrong?