-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Unspecific exception text on unknown type #6910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please provide a stack trace, so it's possible to find the code that throws this exception. Also, you're reporting this on the DBAL repo, but the reproducer uses ORM code. The DBAL does not know about the ORM and therefore cannot provide a class and field name. |
The stacktrace is the following: There's no userland code in it. I'm reporting it here because the exception is in the DBAL component. I think the exception can be handled in the
Maybe something like that code: public function addColumn(string $name, string $typeName, array $options = []): Column
{
try {
$column = new Column($name, Type::getType($typeName), $options);
} catch (\Exception $e) {
throw new \RuntimeException("Error in {$this->getName()}.{$name}: " . $e->getMessage(), previous: $e);
}
$this->_addColumn($column);
return $column;
} |
Handling it at the DBAL level is a good idea, because it should be good enough for ORM users, and will benefit people that use the DBAL but not the ORM. Please send a PR. |
Bug Report
Summary
Unspecific exception text on unknown type used in field definition.
Current behavior
Exception message:
Expected behavior
Same detailed explanation, but also specifying the erroneous class and field name.
How to reproduce
The text was updated successfully, but these errors were encountered: