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

@@ -38,7 +38,7 @@ class Manager {
if (is_null($config))
{
throw new \Exception("Database connection is not defined for connection [$connection].");
throw new \OutOfBoundsException("Database connection is not defined for connection [$connection].");
}
static::$connections[$connection] = new Connection(static::connect($config), $config);
@@ -88,7 +88,7 @@ class Manager {
return new Connectors\Postgres;
default:
throw new \Exception("Database driver [$driver] is not supported.");
throw new \DomainException("Database driver [$driver] is not supported.");
}
}
@@ -127,4 +127,4 @@ class Manager {
return call_user_func_array(array(static::connection(), $method), $parameters);
}
}
}