Improve test coverage for errors.

These commits add test coverage for errors. See individual commit messages for details. In summary:

- Add tests for error and error messages.
- Custom error classes should inherit from `BaseError`, or [be deleted entirely](http://www.youtube.com/watch?v=o9pEzgHorH0).
- Fix missing error message for `ColumnDef` `_gen_type` method.