update error messages

this patch updates the error messages to report the function call
and the file that is trying to be accessed.