Hi there,
I'm working on a method in PHP on which I use try/catch but amfphp doesn't return the appropiate message when I get into the catch block.
For example:
I tried with throw and with return on the catch block to get the error message but nothing worked... Any advice?PHP Code:class TestPhp{
function TestPhp(){}
function MyMethod(){
try{
$success = call-something...
}catch (Exception e){
$errorMessage = "you messed up";
message return
}
return $success;
}
The amfphp browser keeps telling me this TypeError: Error #1009:
Thanks in advance.
Bye.
If you get rid of all the syntax errors in your php it should work.
In particular the following works for me.
class TestPhp{
functionMyMethod(){
try{
$success = $rubbish->$nonsense/0;
}catch (Exception $e){
$errorMessage = "you messed up";
return $errorMessage;
}
return$success;
}
}
Bookmarks