Better driver errors #177

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@schmittjoh
Member

No description provided.

@travisbot

This pull request passes (merged 680fcf1 into 3d426e5).

@stof stof commented on the diff Jul 25, 2012
lib/Doctrine/DBAL/Connection.php
}
- } else {
- $stmt = $this->_conn->query($query);
+ } catch (\Exception $ex) {
+ throw DBALException::driverExceptionDuringQuery($ex, $query, self::resolveParams($params, $types));
@stof
stof Jul 25, 2012 Member

resolveParams is not static

@stof stof commented on the diff Jul 25, 2012
lib/Doctrine/DBAL/Connection.php
+ }
+ } else {
+ // Named parameters
+ foreach ($params as $name => $value) {
+ if (isset($types[$name])) {
+ $type = $types[$name];
+ list($value,) = $this->getBindingInfo($value, $type);
+ $resolvedParams[$name] = $value;
+ } else {
+ $resolvedParams[$name] = $value;
+ }
+ }
+ }
+
+ return $resolvedParams;
+ }
@stof
stof Jul 25, 2012 Member

doesn't this duplicate some logic ?

@schmittjoh schmittjoh closed this Jul 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment