Exception line-number in Jscript-ASP
I'm developing a website with server-side JScript engine over ASP server.
I h开发者_如何学运维ave 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!
The err object (of type ASPError) has Line and File properties - just what you need (see this for more properties).
精彩评论