error signal

Norbert Hartl norbert at hartl.name
Mon May 7 14:38:02 UTC 2007


On Mon, 2007-05-07 at 16:26 +0200, Damien Cassou wrote:
> Hi Norbert,
> 
> 2007/5/7, Norbert Hartl <norbert at hartl.name>:
> >         error signal = true
> >                 ifTrue:
> >                         [self reset.
> >                         self logout.
> >                         self reLogin.
> >                         exception restart]
> >
> > This code comes from VW. Is the signal method implemented
> > differently under VW. In squeak the "error signal" itself
> > throws the error so there is no ifTrue: evaluation, right?
> 
> Are you sure that 'error' is an instance of Exception or one of its
> subclasses? Maybe it's something else.

No, it is

handleError: exception for: command
	| errorClass error |
	errorClass := command isReadCommand
		ifTrue: [GlorpDatabaseReadError]
		ifFalse: [GlorpDatabaseWriteError].
	error := errorClass new.
	error command: command.
	error databaseError: (self innerExceptionFor: exception).
	error accessor: self.
	error signal = true
		ifTrue:
			[self reset.
			self logout.
			self reLogin.
			exception restart]
		ifFalse: [error return: nil].

And GlorpDatabaseReadError has Error as super super class.

> 
> Moreover, I don't see the point of 'something = true ifTrue:'. Why
> not: 'something ifTrue:'?
> 
Me neither but I didn't write it ;) And it is no problem so far.

Norbert




More information about the Squeak-dev mailing list