Subject: | suggestoin for some error messages |
DBIx-Class-Migration-0.020 on Ubuntu 10.10
Hi John,
I wanted to report two somewhat cryptic error messages that could be
clariified a bit:
1)
When a new Schema class is first defined and has no $VERSION set, the
error message thrown when issuing the "status" command is unclear:
Attribute (schema_version) does not pass the type constraint because:
Schema version must be defined at reader
DBIx::Class::DeploymentHandler::Dad::schema_version [...]
Would be great if presence of $VERSION could be tested first and the
error message could then be:
Definition of $VERSION missing in Schema class. Please check out the
tutorial for setting and maintaining versions for your schema class.
2)
If there are errors at compile time in a class using
DBIx::Class::Migration::RunScript, the error message is set to:
[...] should define an anonymouse sub that takes a schema but it didn't!
This is a bit cryptic as it does not point to the real error (the sub is
actually defined but it has errors).
I would suggest at least to add to the error message a hint that this
could be caused by a syntax error in the subroutine, so user should run
the script through perl -c
To reproduce this, just introduce an arbitrary syntax error in a perl
migration script.
Cheers,
Frank