[plt-scheme] Exceptions and the printed messages

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Oct 25 08:15:57 EDT 2005

At Tue, 25 Oct 2005 00:42:30 -0300, Pupeno wrote:
> I have some pieces of source code on DrScheme that have exceptions and when 
> one is raise I get:
> uncaught exception: #<struct:schemeql-bad-column-spec>
> Is it possible to get more info that that, like the contents of the 
> exceptions ? easily.
> I'd like to get the string of the exception printed out, like on errors, is 
> that possible ?

Make `schemeql-bad-column-spec' a sub-type of a suitable built-in
exception, such as `exn:fail:contract':

 (define-struct (schemeql-bad-column-spec exn:fail:contract) (....))

Then it will inherit a `message' field, and DrScheme will know to
extract and print the error message.


Posted on the users mailing list.