how to debug Exception during file read/write
I'm having problem while trying to create a log file using the command
Log.SaveResultsAs(path+fileName+".mht",2)
Where path & fileName are dynamically generated. And I do understand if there's no Path (on the computer), TC/TE creates one. So the above piece of code used to work fine for me, over the past two months, but all of a sudden I dont see any log file being created, coz the above command returns a boolean false.
The problem now is, I dont know what is causing the above function to return a False value, when the same thing was working earlier. If the code would have been returning an exception it would have been easy for me to debug what was causing the problem. How do I make the code to throw an exception with what is causing the problem?
I had a similar problem couple of days back, I was trying to write a file, which was opened in read mode by some other function, and when the function ended, the filepointer wasn't closed, hence was causing trouble for the later function to open a write pointer. But as there was no exception being throw, it took me one whole day to debug what was causing the problem as all it returned was False.
Thanks,
Mateen