Skip to content

Commit

Permalink
Don't use robust "key not found" error when errors are suppressed
Browse files Browse the repository at this point in the history
The robust error message involves calling "alarm", which will cancel
any alarms we might be trying to catch using "try" or ??.

Closes: #3524
  • Loading branch information
d-torrance committed Oct 27, 2024
1 parent 00079fc commit 14766ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions M2/Macaulay2/d/hashtables.dd
Original file line number Diff line number Diff line change
Expand Up @@ -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 := (
Expand Down

0 comments on commit 14766ae

Please sign in to comment.