[m-rev.] Improved array error messages

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Jan 22 20:04:18 AEDT 2002


On 22-Jan-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Fergus Henderson, Monday, 21 January 2002:
> > +	throw(array__index_out_of_bounds(
> > +		string__format("%s: index %d not in range [%d, %d]",
> > +			[s(PredName), i(Index), i(Min), i(Max)]))).
> 
> Calling throw/1 means we don't get the software_error/1 wrapper around
> the exception.

Right.

> Do I then take it that software_error/1 indicates an
> internal problem (i.e. something the compiler/library writer caused
> rather than the user)?

I'm not sure what you mean by "user" here -- do you mean the
programmer, or the end user?

software_error/1 indicates a problem that is internal to the software,
i.e. that is due to either the programmer or the Mercury implementors
stuffing up; it can be anything which is not the end user's fault.

array__index_out_of_bounds/1 is really a special case of software_error/1.
I'm not sure why we have a separate type for that.

But my change didn't modify the status quo on that issue,
so I'll go ahead and commit it.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list