Exception handling

M

mike

Hi,

I need to catch an exception from my code in package B.

This is the try-catch of the calling code in package A:

try {
String dialogId =
context.getScenario().createNewDialog(agentAddress);
context.setBPartyDialogId(dialogId);
context.pushTargetedState(new
CallToAgentIsBeingSetUp(context));
} catch (SipException se) {
logger.severe("Agent address" + agentAddress + "
could not be parsed.");
hangUp();
}


The code I am trying to call is located in another package B.

try {
address = myFactory.createAddress(presentationAddress);
} catch (ServletParseException e) {

throw new SipException(Reason.PARSEERROR, e);
}

Since Package B already has a dependency to package A the addition of
a try-catch of SipException will force me to import a SipException.
And then I will have a cyclic dependency that I want to avoid.

Any suggestions on how I can handle this?

cheers,

//mike
 
R

Roedy Green

And then I will have a cyclic dependency that I want to avoid.

Java does not mind circular dependencies. Just use ANT to compile, or
compile your whole directory at once with javac *.java
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top