开发者

Exception line-number in Jscript-ASP

开发者 https://www.devze.com 2022-12-13 09:50 出处:网络
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:

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消