<?phpclass aaException extends Exception{
public function errorMessage()
{
$error="fuuuuuuuck";
return $error;
}
}
try{
$m=exec("python 2.py");
print "hello";
$n=exec("python 1.py");
if(!$m){
throw new Exception("failed1111");}
if(!$n){
throw new aaException("ffffaaaa");}
}
catch(Exception $e){
echo $e->getmessage();
}
catch(aaException $e){
echo $e->errorMessage();
}
?>
1.py 2.py都没有,应该抛出两个异常,为什么只打印failed1111
public function errorMessage()
{
$error="fuuuuuuuck";
return $error;
}
}
try{
$m=exec("python 2.py");
print "hello";
$n=exec("python 1.py");
if(!$m){
throw new Exception("failed1111");}
if(!$n){
throw new aaException("ffffaaaa");}
}
catch(Exception $e){
echo $e->getmessage();
}
catch(aaException $e){
echo $e->errorMessage();
}
?>
1.py 2.py都没有,应该抛出两个异常,为什么只打印failed1111
public function errorMessage()
{
$error="fuuuuuuuck";
return $error;
}
}
try{
$m=exec("python 2.py");
print "hello";
if(!$m){
throw new Exception("failed1111");
}
$n=exec("python 1.py");
if(!$n){
throw new aaException("ffffaaaa");
}
}
catch(Exception $e){
echo $e->getmessage();
}
catch(aaException $e){
echo $e->errorMessage();
}