suggest error catch 

I was unable to add the real code and make it work.
But the general idea should be easy;  More/better error reporting.