🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #189

Exception Question

#189
From: Raul Lorenzo
Date: Wed, 10 May 2006 10:26
42 lines
1541 bytes
Hello,

I have for example the code i attached,
I think that if A.DeleteItem causes an exception, it should be caught in
Doit_subexample, isn�t it? In Init() there isn�t any try, catch.
I have a code similar to this I attached, an the exception isn�t
catched. Why?

class sub_example
{
private void Execute() throws Exception
	{
	//This method could throw an exception.....
	A.DeleteItem(item);

	}

public void Init() throws Exception
	{
	...
	Execute();
	....
	...
	}
}

class main_example
{
public void Doit_subexample
	{
	try
		{
		sub_example.Init();
		}
	catch(Exception e)
		{
		e.printStackTrace();
		}
	}
}

Thanks
Technical Details
Message-ID: <4461bfa5@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!news-out.superfeed.net!sp6iad.superfeed.net!in2.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,b3574edecfc0aa7,start
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII
Subject: Exception Question
From: Raul Lorenzo <rlorenb@agalisa.es>
Date: Wed, 10 May 2006 12:26:27 +0200
Message-ID: <4461bfa5@newsgroups.borland.com>
Lines: 42
NNTP-Posting-Host: 83.54.108.99
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!news-out.superfeed.net!sp6iad.superfeed.net!in2.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
Newsgroups: borland.public.jbuilder.java.language
X-Trace: newsgroups.borland.com 1147256741 83.54.108.99 (10 May 2006 03:25:41 -0700)
User-Agent: Thunderbird 1.5.0.2 (Windows/20060308)
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit