From 4a8aa0acbdd9e9e17875f2c652385fb649dc7255 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 30 Sep 2023 22:22:01 -0600 Subject: [PATCH] throw instantiation_error from error/2 if Error_term uninstantiated (#2060) --- src/lib/builtins.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/builtins.pl b/src/lib/builtins.pl index ec5a9968..b7b60df9 100644 --- a/src/lib/builtins.pl +++ b/src/lib/builtins.pl @@ -2226,4 +2226,7 @@ nl(Stream) :- % % Throws an exception of the following structure: `error(ErrorTerm, ImpDef)`. error(Error_term, Imp_def) :- - throw(error(Error_term, Imp_def)). + ( var(Error_term) -> + throw(error(instantiation_error, error/2)) + ; throw(error(Error_term, Imp_def)) + ). -- 2.54.0