Article View: adobe.scripting.indesign
Article #2454[JS] Error Catching
From: Fred_Goldman
Date: Tue, 16 Dec 2008 00:14
Date: Tue, 16 Dec 2008 00:14
15 lines
1037 bytes
1037 bytes
When you use a try/catch statement you can send the error to a variable.
Then you can set up an alert to tell you the error. For example:
try{
code
code
code
}catch (error){
alert(error)
exit()
}
My question is, is there anyway for the alert to tell me what line the
error was caused on? In the example I just gave, how would I know which
of the three lines of code caused the error?
Technical Details
Message-ID:
<59b7470b.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news4us.nl!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,7b1907371eebed1c,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Fred_Goldman@adobeforums.com Newsgroups: adobe.scripting.indesign Subject: [JS] Error Catching Message-ID: <59b7470b.-1@webcrossing.la2eafNXanI> Date: Mon, 15 Dec 2008 16:14:55 -0800 Lines: 17 User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news4us.nl!webcrossing