Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.help Subject: Re: Some same exceptions used in a given file Date: Sat, 23 Apr 2011 14:40:29 -0400 Organization: A noiseless patient Spider Lines: 20 Message-ID: References: <87r58s28w3.fsf@merciadriluca-station.MERCIADRILUCA> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 23 Apr 2011 18:40:31 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="KiwfXDyOjqGhZBXcfNnZBg"; logging-data="26501"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183jjwVM62nytqnhFJALrhK" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: <87r58s28w3.fsf@merciadriluca-station.MERCIADRILUCA> Cancel-Lock: sha1:++WTBaKgid2TUd6KUGcJeFvOkEc= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.help:613 On 4/23/2011 1:08 PM, Merciadri Luca wrote: > In some of my code files, I've got the following catch block > > == > catch (IOException cantOpenFile) > { > System.err.println("Can't open " + inputFilename + "."); > System.exit(1); > } > == > more than once, but at different places in the file. Is it possible to > define this somewhere so that I can directly catch the exception with > the two given commands? (Just as one would define his own exception.) Could you give an example of what you're trying to do? (The above isn't sufficiently informative.) -- Eric Sosman esosman@ieee-dot-org.invalid