Issue Details (XML | Word | Printable)

Key: DBAL-28
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Benjamin Eberlei
Reporter: Tomasz Jędrzejewski
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Doctrine DBAL

Better error messages while creating schema

Created: 28/Jun/10 02:43 PM   Updated: 28/Jun/10 04:45 PM
Component/s: Schema Managers
Affects Version/s: 2.0.0-BETA2
Fix Version/s: 2.0.0-BETA3

Environment: Linux, PostgreSQL 8.4, PHP 5.3.2


 Description  « Hide
I'd like to suggest some improvements in the schema builder concerning error messages, which do not tell the most important information needed to find the problem quickly and without irritation. Below, I present a simple case I encountered yesterday: I had a quite big schema to generate, but I made a mistake in index column names. Doctrine thrown me the following exception:
Doctrine\DBAL\Schema\SchemaException
An unknown column-name name was given.

What I miss, is the table name, where I try to define such an index. I took a look at the messages for SchemaException and I noticed that none of them provides it, except those ones which refer directly to tables.

Another small, but useful improvement is enclosing the table/column/index/sequence/anything-else names in quotes or double quotes in order to make them better distinguishable from the message body. My first impression from the message above was that I have a "column-name" name defined somewhere, not a column named "name".

To sum up, the expected message should look like this:

Doctrine\DBAL\Schema\SchemaException
An unknown column-name 'name' was given for index 'foo' in table 'bar'.

The problem is minor, but I would be grateful if you remembered about it in the near future, so that I could have more useful error messages at least in the stable releases.



 All   Comments   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Benjamin Eberlei added a comment - 28/Jun/10 04:45 PM
fixed, changed on other exceptions also.