Yes, something like this:

(define (print-exn exn)
    ((error-display-handler)
     (if (exn? exn)
         (exn-message exn)
         (format "~a" exn))
     exn))

On Thu, Aug 27, 2020 at 3:31 PM Shriram Krishnamurthi <shri...@gmail.com>
wrote:

> Given an exception, is there a way to print the error using Racket's
> conventional error printing machinery (e.g., in color in DrRacket, etc.),
> without halting execution?
>
> I would like to be able to integrate this with #%printing-module-begin and
> #%top-interaction. Unfortunately, those by default will halt execution
> after printing the message.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/a6277017-9dc8-44d1-8c97-119cb431cf4bn%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/a6277017-9dc8-44d1-8c97-119cb431cf4bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdONeeLAF38_cSPk12JT4W3T4Gruh5ET4tHYDrS_-zHHJ4g%40mail.gmail.com.

Reply via email to