help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] MNU in Date class>>readFrom:


From: Stefan Schmiedl
Subject: [Help-smalltalk] MNU in Date class>>readFrom:
Date: Thu, 03 Feb 2011 20:17:36 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]