call0(In,Out) :-
call1(f(In),Out).
call1(In,Out) :-
call2(g(In),Out).
call2(In,Out) :-
Out = h(In,In),
throw(error("when I say the word, you will forget everything",_)).
Then:
?- set_prolog_flag(debugger_write_options,[max_depth(100)]). % this has no effect
?- debug
[debug] ?- call0(a,Out).
ERROR: Unknown error term: "when I say the word, you will forget everything"
ERROR: In:
ERROR: [13] throw(error("when I say the word, you will forget everything",_22758))
ERROR: [12] call2(g(f(a)),h(g(...),g(...))) at user://1:14
ERROR: [11] call1(f(a),h(g(...),g(...))) at user://1:11
ERROR: [10] call0(a,h(g(...),g(...))) at user://1:8
ERROR: [9] <user>
Exception: (13) throw(error("when I say the word, you will forget everything", _22180)) ?
Sadly, the terms are shortened. Apparently, setting debugger_write_options
changes nothing. But maybe there is another way?