update-index.rb: updated error handling