Updated formatting
Replaced e.printStackTrace() with log statements
Added error handler with retry
adjusted error message