Hi all,
how can I catch an existence_error ?
I'm just trying to open a file stream and handle the possibility that the file doesn't exists.
So when I do open( ... ) and the file doesn't exists, it just throws a existance_error.
I tried with the catch/3 predicate...but I don't know what to write on the 2th argument...I tried with a user defined exception and it worked..but I don't know how to handle the existence_error.. (tried with existence_error(X,Y) and it doesn't work).
Any idea?
Thank you
how can I catch an existence_error ?
I'm just trying to open a file stream and handle the possibility that the file doesn't exists.
So when I do open( ... ) and the file doesn't exists, it just throws a existance_error.
I tried with the catch/3 predicate...but I don't know what to write on the 2th argument...I tried with a user defined exception and it worked..but I don't know how to handle the existence_error.. (tried with existence_error(X,Y) and it doesn't work).
Any idea?
Thank you