[Glass] Exception and ObjectLogEntry question

Mariano Martinez Peck via Glass glass at lists.gemtalksystems.com
Wed May 4 10:51:57 PDT 2016


On Wed, May 4, 2016 at 1:50 PM, Smalltalk <smalltalk at adinet.com.uy> wrote:

> Mariano,
>
> Thanks for the answer. But it was my fault #defaultAction was answering
> aBlock (instead the operations) and it should not.
> So #defaultAction was being executed but it did nothing because it was
> aBlock.
>
> And Seaside does not abort a transaction when a Exception is signaled (i
> assumed that i do not know why :) )
>
>
Yes, I also thought that!! I don't know why either hahahahah.


> Regards,
> Bruno
>
> El 02/05/2016 a las 9:25, Mariano Martinez Peck escribió:
>
>
>
> On Sun, May 1, 2016 at 10:31 PM, BrunoBB via Glass <
> <glass at lists.gemtalksystems.com>glass at lists.gemtalksystems.com> wrote:
>
>> Hi All,
>>
>> I have an exception called: AlreadyExistApplicationOrFormNameException.
>>
>> The code is like this:
>> [aBoolean
>>         ifFalse: [self doSomething]
>>         ifTrue: [AlreadyExistApplicationOrFormNameException signal].
>> ] on: AlreadyExistApplicationOrFormNameException
>> do: [:ex | (ObjectLogEntry info: 'Rejected Form Save' object: ex)
>> addToLog.
>> ^System commit].
>> self doMoreThings.
>>
>> The System commit is because Seaside will abort the transaction when an
>> Exception is thrown preventing the log entry to be saved.
>>
>> For now everything is OK.
>>
>> But i want to move this code to #defaultAction in the Exception:
>> defaultAction
>>         "When this exception happend nothing is done (just resume the
>> execution).
>>         Seaside will abort the Request and the Form will be not stored in
>> the
>> repository"
>>
>>         ^[:ex | (ObjectLogEntry info: 'Rejected Form Save' object: ex)
>> addToLog.
>>                         System commit.
>>                         ex resume].
>>
>> But there is nothing in the ObjectLogEntry.
>>
>> Any idea what is wrong with this ?
>> (i have read chapter 13 "Handling Exceptions" but not idea why the entry
>> is
>> not saved)
>>
>>
> This is a very good question. And I am not sure about my answer, but let
> me try.
> As far as I remember, the #defaultAction is called only if there is no
> exception handler (an #on:do: that catches it) in the stack. So...what I
> suspect, is that you exception is being handled by one of the Seaside
> GemStone handlers, preventing your #defaultAction.
>
> Let me ask...what is the superclass of
> AlreadyExistApplicationOrFormNameException? Error?
>
> You may want to check the method #seasideProcessRequest: aNativeRequest
> adaptor: adaptor resultBlock: resultBlock
> Or similar...
>
> Another possibility might be that the #defaultAction is being called but
> that for some reason the commit is not working. Did you try writing to
> transcript/logfile in #defaultAction to know if it is being called or not
> or if it is a commit problem?
>
> Cheers,
>
> Regards,
>> Bruno
>>
>>
>>
>> --
>> View this message in context:
>> http://forum.world.st/Exception-and-ObjectLogEntry-question-tp4893180.html
>> Sent from the GLASS mailing list archive at Nabble.com.
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20160504/ed6718e6/attachment.html>


More information about the Glass mailing list