Commit 4cfb32db authored by Benjamin Eberlei's avatar Benjamin Eberlei

Enhance error reporting in date related types when a ConversionException is thrown

parent cd8e768c
......@@ -57,6 +57,9 @@ class ConversionException extends \Doctrine\DBAL\DBALException
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
);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment