Hi,

I noticed an error message that is not as helpful as it could be:

st> Date readFrom: (ReadStream on: '')
Object: nil error: did not understand #isAlphaNumeric
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #isAlphaNumeric (SysExcept.st:1407)
Date class>>readFrom: (Date.st:258)
UndefinedObject>>executeStatements (a String:1)

Who (class, not person ;-) is responsible here?

Should Date class>>readFrom: return nil when passed an empty stream?
Could this method maybe raise a better suited exception, like SystemException.InvalidArgument? Should the sender of the message check for an empty backing of the ReadStream?

I encountered this problem while inspecting the result of a query:

An instance of DBI.PostgreSQL.PGTable
  name: 'users'
  attributes: nil
  connection: a PGConnection
  columns: nil
columnsArray: (DBI.PostgreSQL.PGTableColumnInfo(id integer(0) not null) DBI.PostgreSQL.PGTableColumnInfo(created_at timestamp without time zone(0) not null) DBI.PostgreSQL.PGTableColumnInfo(updated_at timestamp without time zone(0)) DBI.PostgreSQL.PGTableColumnInfo(deleted_at timestamp without time zone(0)) DBI.PostgreSQL.PGTableColumnInfo(username character varying(50) not null) DBI.PostgreSQL.PGTableColumnInfo(password character varying(50) not null) )
  contents: [
Object: nil error: did not understand #isAlphaNumeric
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #isAlphaNumeric (SysExcept.st:1407)
DateTime class(Date class)>>readFrom: (Date.st:258)
DateTime class>>readFrom: (AnsiDates.st:114)
DBI.PostgreSQL.PGColumnInfo class>>convertDateTime: (DBD-PostgreSQL.star#VFS.ZipFile/ColumnInfo.st:78)

So where should this be fixed? In Date and DateTime or in DBI.PostgreSQL.PGColumnInfo?

Curious,
s.

_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to