From ce7b9f7b6f71327e95dd5c33cf77d00ff7c53d51 Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Mon, 3 Dec 2012 22:17:53 -0700 Subject: [PATCH] Deal with bad metadata more gracefully Without this patch, you can't uninstall or do anything if a single package has broken metadata, because everything crashes. --- collects/planet2/lib.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/collects/planet2/lib.rkt b/collects/planet2/lib.rkt index dd41bd65cf..0e208691c4 100644 --- a/collects/planet2/lib.rkt +++ b/collects/planet2/lib.rkt @@ -122,7 +122,9 @@ (define (get-metadata metadata-ns pkg-dir key get-default #:checker [checker void]) - (define get-info (get-info/full pkg-dir #:namespace metadata-ns)) + (define get-info + (with-handlers ([exn:fail? (λ (x) #f)]) + (get-info/full pkg-dir #:namespace metadata-ns))) (define v (if get-info (get-info key get-default)