In general I do not like cull: and I'm really suspicious about its use.
It often reveals a lack of coherence and/or design.
Why this is not simply

BlockClosure>>ifError: errorHandlerBlock

^ self on: Error do: errorHandlerBlock

??


Hi

I look at implementation of BlockClosure>>ifError: . I did't know that it culls arguments to errorBlock. But what is this arguments? It is not error instance but specific properties from it.

    BlockClosure>>ifError: errorHandlerBlock

    ^ self on: Error do: [:ex |
    errorHandlerBlock cull: ex description cull: ex receiver]


Why people doing that?
Many users of it just pass given error like

    [...] ifError: [:msg :rcv | ...

         rcv error: msg].


Especially it is commonly used scenario by senders of #critical:ifError:. But it is different question.
I propose change ifError: to cull error instance.

What you think? Can be put it in Pharo 5? Such change can touch some packages

Reply via email to