Permalink
Browse files

Enhance error reporting in date related types when a ConversionExcept…

…ion is thrown
  • Loading branch information...
1 parent cd8e768 commit 4cfb32db00da53638bc2dca84e3e63553fdf3c5b @beberlei beberlei committed Jun 26, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/Doctrine/DBAL/Types/ConversionException.php
View
5 lib/Doctrine/DBAL/Types/ConversionException.php
@@ -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.