[squeak-dev] Exception patterns (The Inbox: Kernel-ct.1292.mcz)

Christoph Thiede christoph.thiede at student.hpi.uni-potsdam.de
Thu Oct 8 18:01:11 UTC 2020


Hi all,

I'd like to push this discussion again because I still do think that an
#on:when:do: mechanism or whatever you'd like to call it can be useful in
several situations.

One of my favorite usages is this:

[self downloadFile: aFile
    on: HttpError "this is from one of my packages"
    when: [:ex | ex statusCode = 403]
    do: [self inform: 'Forbidden!'].

Do I see it right that we only need to find a better name for this or am I
the only one who would like to something like this in the Trunk?
And would anyone be so kind and leave some feedback on my other proposal for
exception conditions? :-)

[self downloadFile: aFile
    on: HttpError & [:ex | ex statusCode = 403]
    do: [self inform: 'Forbidden!'].

Best,
Christoph



--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html


More information about the Squeak-dev mailing list