try {
$this->mObj->checkOperation();
} catch (DomainException $e) {
$this->alertRedirect('danger', $e->getMessage(), '/operations');
}
try {
$this->mObj->checkMission();
} catch (DomainException $e) {
$this->alertRedirect('danger', $e->getMessage(), "/operation-{$this->mObj->oid}/missions");
}
class A {
public function checkOperation() {
throw new ADomainException;
}
}
class B {
public function checkMission() {
throw new BDomainException;
}
}
try {
$this->mObj->checkOperation();
$this->mObj->checkMission();
} catch (ADomainException $e) {
$this->alertRedirect('danger', $e->getMessage(), '/operations');
} catch (BDomainException $e) {
$this->alertRedirect('danger', $e->getMessage(), "/operation-{$this->mObj->oid}/missions");
}