Wouldn't printStackTrace be better, it shows also the line number and the error. Just by using catch Execption errror