Skip to content

Commit

Permalink
Enhance error reporting in date related types when a ConversionExcept…
Browse files Browse the repository at this point in the history
…ion is thrown
  • Loading branch information
beberlei committed Jun 26, 2011
1 parent cd8e768 commit 4cfb32d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Doctrine/DBAL/Types/ConversionException.php
Expand Up @@ -57,6 +57,9 @@ static public function conversionFailed($value, $toType)
static public function conversionFailedFormat($value, $toType, $expectedFormat)
{
$value = (strlen($value) > 32) ? substr($value, 0, 20) . "..." : $value;
return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType);
return new self(
'Could not convert database value "' . $value . '" to Doctrine Type ' .
$toType . '. Expected format: ' . $expectedFormat
);
}
}

0 comments on commit 4cfb32d

Please sign in to comment.