Brock Pytlik wrote: > John Rice wrote: > >> Broc - surely all we need here is to define a set of appropriate >> exceptions to throw when something goes wrong and have the different >> clients handle the exceptions appropriately. For us on the GUI side we >> may pop up a dialog to warn the user, on the cli you might print >> something out on the command line. >> >> The exceptions are part of the API and give clients a clean way to >> interact with all error conditions the API might raise. Apologies if >> I'm telling you guys how to suck eggs, but this change from the cli >> focus of outputting error messages in the bowels of IPS to the >> terminal, towards a general approach of raising well documented >> exceptions is really important if we are to have a client API with the >> appropriate level of separation between the clients and the underlying >> IPS engine. >> > Two things. First, the proposal below has nothing to do with the > existing bug (Note I've changed the subject line). > > Second, there are times when exceptions aren't adequate (and are fairly > heavy weight) for passing messages. For example, in this situation, the > install succeeded. IMO, that means that > install/imageplan.execute/whatever shouldn't be throwing an indexing > exception up the stack. Your data on disk has been changed, your BE has > been updated, etc... If we separated out the indexing from > imageplan.execute, something I'd probably be against for code > maintenance issues (but don't have strong feelings about) then the > imageplan.post_execute_update_index method could throw an exception and > it would be up to the caller to adequately handle telling the user the > install succeeded but the index update failed. > Ah ok - maybe its just a java thing I tend to like throwing exceptions and using them to document all error conditions at the API boundary for the clients to handle. So if execute does indexing stuff then so be it and it can raise an indexing error. As long as its documented then all will be well and the clients can handle the fall out :) But as you say no strong opinions either way.
JR > Brock > _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
