From 81bdbb19e93df12af059ace7aa803d162b123eaa Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Wed, 14 Aug 2019 11:07:31 -0400 Subject: [PATCH] Add guide documentation on printing exception information. Suggested by badkins. --- pkgs/racket-doc/scribblings/guide/control.scrbl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/racket-doc/scribblings/guide/control.scrbl b/pkgs/racket-doc/scribblings/guide/control.scrbl index 515de67a76..26f122dd7d 100644 --- a/pkgs/racket-doc/scribblings/guide/control.scrbl +++ b/pkgs/racket-doc/scribblings/guide/control.scrbl @@ -117,6 +117,20 @@ predicate: (error "user break")) ] +Exceptions carry information about the error that occurred. The +@racket[exn-message] accessor provides a descriptive message for the +exception. The @racket[exn-continuation-marks] accessor provides +information about the point where the exception was raised. +@margin-note{The @racket[continuation-mark-set->context] procedure provides best-effort structured backtrace information.} + +@interaction[ +(with-handlers ([exn:fail? + (lambda (v) + ((error-display-handler) (exn-message v) v))]) + (car 17)) +] + + @; ---------------------------------------- @section[#:tag "prompt"]{Prompts and Aborts}