Jordan Brown (Sun) wrote:
> Renaud Manus wrote:
>> You cannot just return scf_error() because fmri_to_entity()
>> is only supposed to return:
>> SCF_ERROR_NO_MEMORY
>> ...
> 
> Drive-by design comment:
> 
> Callers should never assume that they know the full list of errors that 
> a function could return.  There might be a favored few that are likely 
> and have well-documented meanings, but the caller should always be 
> prepared to handle *any* error return, including error codes that were 
> not defined when the caller was written.

The return is from an internal function.  The interaction can be as 
precise as the author chooses.

And the original author has defined a precise interaction here. It would 
be inappropriate to change the precision of interaction for callers for 
just this function.  I'm generally against changing local coding 
conventions piecemeal, as it makes future maintenance confusing.

Thus, I agree with Renaud's comment and wouldn't recommend conforming to 
your drive-by-design advice as part of this fix.

liane

Reply via email to