|
From: <php...@li...> - 2008-05-08 21:22:46
|
To all:
I'm using:
php bridge: 5.1.2
java: jdk1.6.0_02
php: 5.2.5
Here's my question i'm trying to figure out the best way to deal with
errors from the php side throw from java.
Here's an example:
Java:
public class Test{
public Test(String yippie) Throws Exception
{
if(yippie)
{
ex = new Exception("This is an exception thrown from java");
System.out.println("Exception: " + ex.getMessage());
throw ex;
}
}
}
PHP:
try{
$email_address_obj = new Java("type.Test", $email_address);
return $email_address_obj;
} catch (JavaException $ex)
{
echo "Cause: ".$ex->getCause()."\n";
echo "Message: ".(string) $ex->getMessage()."\n";
}
Trouble:
My issue is, I want to out the message Exception was instantiated
with ("This is an exception thrown from java"). However, the
Throwable::getMessage() method is not giving me anything on the php
side, but it is giving me what I want on the java side. Conversely,
the Throwable::getCause() is giving me exactly what is expected.
Any thoughts or help would be greatly appreciated!
Cheers,
Zach
__________________
Gulo Solutions
http://blog.gulosolutions.com
773.276.8066
|