Capturing error line on exception (SWI)



Hi,

does anybody know how to get the error line of an error in swi prolog?
Before trying to explain I give you an example:

go :-
...,
ensure_loaded('myfile.pl'),
...

if an error occurs in 'myfile.pl' an error message is printed which tell me
the error line no.
But suppose I am currently use catch/3 or call_cleanup/3...
how can I get the error line number?
I firstly tried to access the stream_property/2 (with $stream_position)
using current_input/1, but I realized that the stream associated with
'myfile.pl' is suddenly closed after an error occurs (ie. it does no longer
exist when I call current_input/1, which fails).

Does any way to get the error line number exist, when we consult external
files?

Thank you.
M


.



Relevant Pages