PackageManager #install: has wrong comment

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PackageManager #install: has wrong comment

Tim M
The #install: method for PackageManager seems to indicate that it
throws an exception if pre-req's can't be loaded

"The receiver attempts to load any prerequsite packages from the same
path
        location as that of the requested package, but if a suitable package
then the 'prerequisite
        not found' exception is signalled. The caller can trap this exception
(the
        <exceptionSelector> can be accessed using the class side
#prerequisiteNotFoundSignal"


However this isn't true - the code seems to indicate it traps the
exception and returns an empty collection.


Tim


Reply | Threaded
Open this post in threaded view
|

Re: PackageManager #install: has wrong comment

Blair-2
"TimM" <[hidden email]> wrote in message
news:[hidden email]...

> The #install: method for PackageManager seems to indicate that it
> throws an exception if pre-req's can't be loaded
>
> "The receiver attempts to load any prerequsite packages from the same
> path
> location as that of the requested package, but if a suitable package
> then the 'prerequisite
> not found' exception is signalled. The caller can trap this exception
> (the
> <exceptionSelector> can be accessed using the class side
> #prerequisiteNotFoundSignal"
>
>
> However this isn't true - the code seems to indicate it traps the
> exception and returns an empty collection.
>

No, this is true, and is in fact the way that the PackageSelector allows the
user to browse for prerequisites that are not found. If you look more
closely you'll see that there are two different exceptions involved here.
The exception mentioned in the comment is actually a type of notification,
which means that if it is not handled anywhere then the code will just try
to continue, and eventually the different package not found error will get
signalled, and that error is indeed trapped by the #install: method. This is
an example of how resumable exceptions can be used as lightweight
extensibility points (at least in terms of code, if not conceptually).

Regards

Blair