• Create Account

### #ActualInstigator

Posted 21 September 2012 - 09:41 AM

Hello,
I have an application which excepts a username and password input from the user. Then attempts a network connection, 3 classes deep from my form events (the view). So deep in my networking connection I want to throw and Exception and log some text for the user to see. So..

with in this method I have something like..
public boolean doAConnect() [b]throws Exception[/b]
{


the problem is that in my view when I use the try/catch, I am getting a "Java.lang.exception error: <error message here>". I only want the error message I set! Any ideas how I can just show the message to the user without the "Java.lang.Exception error:" pre-pended onto my string?
try{
doAConnect()
}
catch(Exception e)
{
}


### #3Instigator

Posted 21 September 2012 - 09:40 AM

Hello,
I have an application which excepts a username and password input from the user. Then attempts a network connection, 3 classes deep from my form events (the view). So deep in my networking connection I want to throw and Exception and log some text for the user to see. So..

with in this method I have something like..
public boolean doAConnect() [b]throws Exception[/b]
{


the problem is that in my view when I use the try/catch, I am getting a "Java.lang.exception error: <error message here>". BUT I do not want to user to see the exception message.
try{
doAConnect()
}
catch(Exception e)
{
}


Any ideas how I can just show the message to the user without the "Java.lang.Exception error:" pre-pended onto my string?

### #2Instigator

Posted 21 September 2012 - 09:38 AM

Hello,
I have an application which excepts a username and password input from the user. Then attempts a network connection, 3 classes deep from my form events (the view). So deep in my networking connection I want to throw and Exception and log some text for the user to see. So..

with this method use
public boolean doAConnect() [b]throws Exception[/b]


throw new Exception("Invalid Username and Password);


the problem is that in my view when I use the try/catch, I am getting a "Java.lang.exception error: <error message here>". BUT I do not want to user to see the exception message.
try{
doAConnect()
}
catch(Exception e)
{
}


Any ideas how I can just show the message to the user without the "Java.lang.Exception error:" pre-pended onto my string?

### #1Instigator

Posted 21 September 2012 - 09:36 AM

Hello,
I have an application which excepts a username and password. Then attempts a network connection, 3 classes deep from my form events (the view). Now in my networking connection I want to throw and Exception and log some text for the user to see. In here I do

throw new Exception("Invalid Username and Password);


having this method use

public boolean doSomething() [b]throws Exception[/b]


the problem is that in my view when I use the try/catch, I am getting a "Java.lang.exception error: <error message here>". BUT I do not want to user to see the exception message.
try{
doSomething()
}
catch(Exception e)
{