throw instantiation_error from error/2 if Error_term uninstantiated (#2060)

This commit is contained in:
Mark
2023-09-30 22:22:01 -06:00
parent 6fa00b5b55
commit 4a8aa0acbd

View File

@@ -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))
).