From 41da16e1c3663668047a575fc0352c5559139cdb Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sat, 26 Oct 2024 16:49:28 -0400 Subject: [PATCH] Don't use robust "key not found" error when errors are suppressed The robust error message involves calling "alarm", which will cancel any alarms we might be trying to catch using "try" or ??. Closes: #3524 --- M2/Macaulay2/d/hashtables.dd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/M2/Macaulay2/d/hashtables.dd b/M2/Macaulay2/d/hashtables.dd index f8f4763578..ca3018f8be 100644 --- a/M2/Macaulay2/d/hashtables.dd +++ b/M2/Macaulay2/d/hashtables.dd @@ -318,10 +318,11 @@ lookup(object:HashTable, key:Expr):Expr; -- forward declaration KeyNotFound(object:string, key:Expr):Expr := ( -- TODO: implement a similar trick to call synonym(object) msg := "key not found in " + object; - see := lookup(Class(key), RobustPrintE); - if see != notfoundE then - when applyEEEpointer(see, toExpr(msg), key) - is str:stringCell do msg = str.v else nothing; + if !SuppressErrors then ( + see := lookup(Class(key), RobustPrintE); + if see != notfoundE then + when applyEEEpointer(see, toExpr(msg), key) + is str:stringCell do msg = str.v else nothing); buildErrorPacket(msg)); export lookup1(object:HashTable,key:Expr,keyhash:hash_t):Expr := (