Throw better Exceptions

This commit is contained in:
Phill Sparks
2011-11-15 12:35:04 +00:00
parent d643ec97dc
commit 58638216e8
23 changed files with 53 additions and 53 deletions

View File

@@ -63,7 +63,7 @@ class Route {
if ( ! $callback instanceof Closure and ! is_array($callback) and ! is_string($callback))
{
throw new \Exception('Invalid route defined for URI ['.$this->key.']');
throw new \InvalidArgumentException('Invalid route defined for URI ['.$this->key.']');
}
}
@@ -226,7 +226,7 @@ class Route {
return $this->is(substr($method, 3));
}
throw new \Exception("Call to undefined method [$method] on Route class.");
throw new \BadMethodCallException("Call to undefined method [$method] on Route class.");
}
}
}