[squeak-dev] Monticello API: raising exceptions

Frank Shearar frank.shearar at gmail.com
Mon Jan 21 23:04:33 UTC 2013


I have a change to InstallerMonticello that allows it to fail over to
an alternate repository. That means that

Installer ss
    package: 'Zippers';
    install: 'Zippers-fbs.52.mcz'.

will attempt to load the mcz from the local cache, but fall over to
the canonical repository. Alternatively, one could say

Installer ss
    package: 'Zippers';
    failover: (Installer ss3 package: 'Zippers'; mc);
    install: 'Zippers-fbs.52.mcz'.

which would try SqueakSource before falling back to ss3.gemstone.com.
(I currently don't support multiple failovers, but I should.)

Now to my question: if you try load a file from an
MCFileBasedRepository that does not exist, you get a
FileNotFoundException. I think this should be caught, and an MCError
(which doesn't exist yet, but should) raised. My rationale is this:
driving Monticello from the outside (like Installer does), I don't
care about the precise kinds of errors that may occur.
FileNotFoundException, NameLookupFailure, whatever, I only care that
MC failed to do something.

In particular, I DO NOT want to catch Error. And, I DO NOT want to
scatter every possible kind of exception that might occur because a
user decided to use a GOODS repository and I forgot to figure out what
kinds of exceptions that kind of repository might throw.

Thoughts? Rethrow underlying exceptions as a generic-but-specific-to-MC MCError?

frank


More information about the Squeak-dev mailing list