diff --git a/pkgs/unstable-pkgs/unstable-doc/scribblings/error.scrbl b/pkgs/unstable-pkgs/unstable-doc/scribblings/error.scrbl index 35730a8272..fb9e746ab9 100644 --- a/pkgs/unstable-pkgs/unstable-doc/scribblings/error.scrbl +++ b/pkgs/unstable-pkgs/unstable-doc/scribblings/error.scrbl @@ -110,3 +110,9 @@ can be appended to the end of a base error message. } @(close-eval the-eval) + +@addition{Jay McCarthy} + +@defproc[(exn:not-break? [x any/c]) boolean?]{Identifies values that are not @racket[exn:break?], i.e. values that are safe to catch with @racket[with-handlers].} + +@defproc[(error-display [x any/c]) void?]{Calls @racket[(error-display-handler)] with the proper arguments whehter @racket[x] is an exception, or not.} diff --git a/racket/collects/unstable/error.rkt b/racket/collects/unstable/error.rkt index e50313280f..07c76edfa7 100644 --- a/racket/collects/unstable/error.rkt +++ b/racket/collects/unstable/error.rkt @@ -181,3 +181,20 @@ TODO [value (cadr lst)]) (cons (cons field value) (field+detail-list->table who (cddr lst) onto)))])) + +;; Added by Jay + +(define (exn:not-break? x) + (not (exn:break? x))) + +(define (error-display x) + ((error-display-handler) + (if (exn? x) + (exn-message x) + "non-exn error:") + x)) + +(provide + (contract-out + [exn:not-break? (-> any/c boolean?)] + [error-display (-> any/c void?)]))