[plt-scheme] Error Checking

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Thu Jun 18 13:43:31 EDT 2009

Hi all,

I have been postponing proper error handling in my program. In
general, I have been just doing (error ...) and that's it. However, I
would like to be a bit more organized and actually catch errors and
provide proper information to the users regarding the nature of the
For that, I have been looking at exceptions.

I thought about generating several exception structures as follows:
exn:fail:user:<type> with parent exn:fail:user
exn:fail:<type> with parent exn:fail

<type> would be a type of error regarding some part of my program, so
user errors in the parser would be thrown as:
exn:fail:user:parser and internal errors as exn:fail:parser which
would carry information, for example of in which filename the parsing
error occurred and at which position. However, to simplify my life I
would like to easily have a raise function for each of these like
raise-user-error I could have raise-user-error/parser or
raise-error/parser respectively. I have tried to look at the
definition of raise-user-error in the plt source code but couldn't
find anything. Can someone point me to it or correct my design if I
could do something simpler?


Paulo Jorge Matos - pocmatos at gmail.com

Posted on the users mailing list.