Skip to content
This repository has been archived by the owner on Oct 27, 2019. It is now read-only.

Commit

Permalink
Better exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Aug 19, 2013
1 parent a56c0b1 commit 8775bef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/MetaModel/Model/MethodCall.php
Expand Up @@ -2,6 +2,7 @@

namespace MetaModel\Model;

use MetaModel\ExecutionException;
use MetaModel\MetaModel;

/**
Expand All @@ -28,6 +29,10 @@ public function execute(MetaModel $metaModel)
{
$object = $this->subNode->execute($metaModel);

if (is_null($object)) {
throw new ExecutionException("Calling method '$this->method' on null");
}

$reflectionMethod = new \ReflectionMethod($object, $this->method);

// God mode
Expand Down

0 comments on commit 8775bef

Please sign in to comment.