remove error printing redundancy and inconsistent state resulting from file_load_cleanup (#1995)
This commit is contained in:
@@ -135,9 +135,15 @@ file_load_init(Stream, Evacuable) :-
|
|||||||
run_initialization_goals.
|
run_initialization_goals.
|
||||||
|
|
||||||
file_load_cleanup(Evacuable, Error) :-
|
file_load_cleanup(Evacuable, Error) :-
|
||||||
|
load_context(Module),
|
||||||
|
abolish(Module:'$initialization_goals'/1),
|
||||||
unload_evacuable(Evacuable),
|
unload_evacuable(Evacuable),
|
||||||
'$print_message_and_fail'(Error),
|
( clause('$toplevel':argv(_), _) ->
|
||||||
throw(Error).
|
% let the toplevel call loader:write_error/1
|
||||||
|
throw(Error)
|
||||||
|
; '$print_message_and_fail'(Error)
|
||||||
|
; throw(file_load_error)
|
||||||
|
).
|
||||||
|
|
||||||
file_load(Stream, Path, Evacuable) :-
|
file_load(Stream, Path, Evacuable) :-
|
||||||
create_file_load_context(Stream, Path, Evacuable),
|
create_file_load_context(Stream, Path, Evacuable),
|
||||||
@@ -505,7 +511,9 @@ consult(Item) :-
|
|||||||
|
|
||||||
use_module(Module) :-
|
use_module(Module) :-
|
||||||
'$push_load_state_payload'(Evacuable),
|
'$push_load_state_payload'(Evacuable),
|
||||||
use_module(Module, [], Evacuable).
|
catch('$call'(loader:use_module(Module, [], Evacuable)),
|
||||||
|
file_load_error,
|
||||||
|
'$call'(builtins:false)).
|
||||||
|
|
||||||
use_module(Module, Exports) :-
|
use_module(Module, Exports) :-
|
||||||
'$push_load_state_payload'(Evacuable),
|
'$push_load_state_payload'(Evacuable),
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ fn do_not_duplicate_path_components() {
|
|||||||
['tests-pl/issue852-throw_e.pl'].\n\
|
['tests-pl/issue852-throw_e.pl'].\n\
|
||||||
halt.\n\
|
halt.\n\
|
||||||
",
|
",
|
||||||
" throw(e).\n false.\n throw(e).\n false.\n",
|
" throw(e).\n throw(e).\n",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user