throw handling
This commit is contained in:
parent
275e2c0059
commit
f7a2c479e7
@ -49,7 +49,7 @@ Errors are terms of the form:
|
||||
|
||||
:- use_system_module( '$messages', [file_location/2,
|
||||
generate_message/3,
|
||||
translate_message/3]).
|
||||
translate_message/4]).
|
||||
|
||||
|
||||
/**
|
||||
@ -109,14 +109,29 @@ system_error(Type,Goal,Culprit) :-
|
||||
flush_output,
|
||||
fail.
|
||||
|
||||
'$process_error'('$abort', top) :- !,
|
||||
print_message(informational,abort(user)).
|
||||
'$process_error'('$abort', _) :- !,
|
||||
throw('$abort').
|
||||
'$process_error'(abort, top) :- !,
|
||||
print_message(informational,abort(user)).
|
||||
'$process_error'(abort, _) :- !,
|
||||
throw(abort).
|
||||
'$process_error'('$forward'(Msg), _) :-
|
||||
!,
|
||||
throw( '$forward'(Msg) ).
|
||||
'$process_error'('$abort', Level) :-
|
||||
!,
|
||||
'$process_error'(abort, Level).
|
||||
'$process_error'(abort, Level) :-
|
||||
!,
|
||||
(
|
||||
Level \== top
|
||||
->
|
||||
throw( abort )
|
||||
;
|
||||
current_prolog_flag(break_level, 0)
|
||||
->
|
||||
print_message(informational,abort(user)),
|
||||
fail
|
||||
;
|
||||
current_prolog_flag(break_level, I0),
|
||||
I is I0-1,
|
||||
current_prolog_flag(break_level, I),
|
||||
throw(abort)
|
||||
).
|
||||
'$process_error'(error(thread_cancel(_Id), _G),top) :- !.
|
||||
'$process_error'(error(thread_cancel(Id), G), _) :- !,
|
||||
throw(error(thread_cancel(Id), G)).
|
||||
|
Reference in New Issue
Block a user