views:

260

answers:

1

Hello all, I'm developing a website with server-side JScript engine over ASP server.

I have several try-catch clauses in my code looking roughly like this:

try {
   // do something
}
catch (err) {
   // pass it to the frontend code
   die("Exception caught: " + err.description);
}

I would very much like to display the line number in which the error occurred. The filename would be a nice bonus but it's not very important. How can it be done?

Thanks!

+2  A: 

The err object (of type ASPError) has Line and File properties - just what you need (see this for more properties).

Traveling Tech Guy
Thanks dude, I should have figured it out :)
Yonatan
But it won't help you as ASPError only gets populated on a 500 error page (well any page but not the one that threw the error, it has to be a seperate page wired up for your 500 errrors on the server). The JScript exception object does not contain enough info either. Been down this route, unfortunately there is no way to get the error details you want.
Pete Duncanson